隨機抽籤
#include<stdio.h>
#include<stdlib.h>
//#include<time.h>
int main(void)
{
int i,score[55],k,flag=0;
//srand(time(NULL));
for(i=1;i<=20;i++)
{
score[i]=1+rand()%51;flag=0;
for(k=0;k<i;k++)
{if (score[i]==score[k]) flag=1;}
if(flag==0)
printf("%2d",score[i]);
else i--;
if(i%5==0){printf("\n");}
}
system("pause");
return 0;
}
Today's Visitors: 0 Total Visitors: 36
歷史上的今天:

Sealed (Aug 24)
1樓
1樓搶頭香
Sealed
2樓
2樓頸推
Sealed
Sealed
3樓
3樓坐沙發
http://www.facebook.com/profile.php?id=100001104901571
我的
偶知
Only friends can post a comment, Login first