#include <stdio.h>
#include <time.h>
int add(x,y)
{int s;
s=x+y;
return s;
}
void srand(int x,int y)
{ srand( (unsigned)time( NULL ) ); /*這個就是生成了壹個種子*/
x=rand()%100; /*通過rand()%100來生成壹個0~99的隨機數,並將它賦給k*/
y=rand()%100;
}
main()
{int i,sum=0;
int x,y;
printf("please count these questions\n");
for(i=0;i<10;i++)
{long c;
srand(x,y) ;
add(x,y);
printf("x+y=");
scanf("%ld",&c);
if(c=add(x,y))sum+=10;
}
printf("Your score is %d:\n",sum);
}