| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
发生成数据程序涨Rp~~~#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<ctime>
const int Limit = 200;
int main()
{
srand((time(NULL) + rand() + 6777)% rand());
srand(((rand() + rand()) % 1234 + rand()) % 5678);
int n = rand() % Limit + 1;
while(n <= 1)
{
n = rand() % Limit + 1;
}
int G[201][201];
int i,j;
memset(G , 0 , sizeof(G));
printf("%d ",n);
int a = rand() % n + 1 , b = rand() % n + 1;
while(a == b)
{
a = rand() % n + 1;
b = rand() % n + 1;
}
printf("%d %d\n",a,b);
for(i = 1 ; i <= n ; ++i)
for(j = i + 1 ; j <= n ; ++j)
{
srand((rand() + rand()) % 143);
G[i][j] = rand() % 2;
}
for(i = 2 ; i <= n ; ++i)
for(j = 1 ; j < i ; ++j)
G[i][j] = G[j][i];
for(i = 1 ; i <= n ; ++i)
{
for(j = 1 ; j <= n ; ++j)
printf("%d ",G[i][j]);
puts("");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator