#include<stdio.h>
#include<stdlib.h>
void main()
{
int a,b,c,d,i,j,k;
int s[10];
k=0;
for (j=0;j<10;j++)
{
do
{
a=rand();
b=(-1)*(rand());
c=rand();
}while (0<=(a+b*c)&&50>=(a+b*c));
if (b==-1)
{
printf("a-c=?\n");
}
else
{ printf("a+c=?\n");}
for (i=0;i<3;i++)
{ printf("答案是\n");
scanf("%d",&d);
if (d==(a+b*c))
{ printf("答案正确\n");break;}
else
{ printf("答案错误,重新再来一次");}
if (i==0)
{s[j]=10;}
else if(i==1)
{s[j]=7;}
else if (i==2)
{s[j]=5;}
else
{
s[j]=0;
printf("正确答案是%d\n",a+b*c);
}
}
for(j=0;j<10;j++)
{ k=k+s[j];}
printf(" 你最终得分是%d\n",k);
}