回覆列表
  • 1 # lanfengz3

    //new -- allocate memory

    #include

    using namespace std;

    #include

    #include

    #include

    int main()

    {

    int n;

    int *p;

    //seed random-number generator

    srand(time(0));

    //input array size n

    cout

    cin >> n;

    //allocate memory

    p = new int[n+1];

    //before sort

    cout

    for (int i = 0; i

    {

    *(p+i) = rand() % 6;

    cout

    }

    cout

    //please write sort function yourself

    sort(p,p+n);

    //After sort

    cout

    for (int i = 0; i

    {

    cout

    }

    cout

    //release memory

    delete p;

    return 0;

    }

  • 中秋節和大豐收的關聯?
  • 一個人女人揹著丈夫出軌了,有什麼特徵呢?