Posted: Mon Jul 09, 2007 8:28 am
Thanks mmonish. I want to chat with you. My id = cse0304003@yahoo.com
Thanks again.
Thanks again.
Code: Select all
512
513 2 2 ... 2 2 1 1 ... 1 1 (511 2's and 511 1's)
0
Code: Select all
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[])
{
srand(time(NULL));
int N[10] = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024};
for (int cases = 1; cases <= 100; cases++)
{
int n = N[rand() % 10];
cout << n << '\n';
for (int i = 0; i < (2 * n - 1); i++)
{
if (i) cout << ' ';
cout << (rand() % 1000 + 1);
}
cout << '\n';
}
cout << "0\n";
return 0;
}