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 |
贴数据生成器!In Reply To:贴题解! Posted by:18357 at 2014-09-25 10:06:42 #include <cstdio> #include <cstring> #include <algorithm> #include <cstdlib> #include <ctime> #define N 10 using namespace std; int main() { freopen("test.in","w",stdout); int i,j,k; int n,m,p; int a,b,c; srand((unsigned)time(NULL)); n=rand()%N+1; printf("%d %d\n",n,rand()%n+1); for(i=2;i<=n;i++) { printf("%d %d\n",rand()%(i-1)+1,i); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator