You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
522 B
35 lines
522 B
#include<stdio.h>
|
|
#include<time.h>
|
|
#include<stdlib.h>
|
|
int main()
|
|
{
|
|
srand((unsigned)time(NULL));
|
|
int i,a,b,J,sum,s[10],T,x,y,g[i];
|
|
for(i=1;i<=10;i++)
|
|
{
|
|
for(a=rand()%51,b=rand()%51;a+b>50||a+b<0||a-b<0;a=rand()%51,b=rand()%51)
|
|
{
|
|
;
|
|
}
|
|
J=rand()%2;
|
|
if(J==1)
|
|
{
|
|
printf("%d:%d+%d=",i,a,b);
|
|
T=a+b;
|
|
scanf("%d",&s[i]);
|
|
for(x=0;x<=2;x++)
|
|
{
|
|
if(s[i]!=T)
|
|
{
|
|
printf("´ð°¸´íÎó£¬ÇëÖØÐÂÊäÈë:\n");
|
|
g[i]=0;
|
|
}
|
|
else if(x==0)
|
|
g[i]=10;
|
|
else if(x==1)
|
|
g[i]=7;
|
|
else if(x==2)
|
|
g[i]=5;
|
|
}
|
|
}
|