Search:

Type: Posts; User: laserlight

Search: Search took 0.13 seconds.

  1. Instead of printing to standard output, push_back...

    Instead of printing to standard output, push_back to a std::vector<int>.
  2. This is wrong: a[5] = i; The array a has 5...

    This is wrong:

    a[5] = i;
    The array a has 5 elements, so a[5] does not exist. Even if it did, it does not make sense to assign i to it since i was not initialised.

    This is wrong:

    for(i = 1;...
  3. You should have nested loops. The inner loop...

    You should have nested loops. The inner loop would just print the elements of the array. The outer loop would loop for the desired number of times, and then shuffle the array before control enters...
Results 1 to 3 of 3