//程式如下,加法 減法各25道
#include
void main()
{
int i,a,b,c,score=0;
srand((unsigned)time(NULL));
for(i=1;i
{ a=rand()%89+10;
b=rand()%89+10;
c=rand()%198;
if(i
printf("%d+%d=%d\n",a,b,c);
if(c==a+b)
{printf("正確!\n");
score+=2;
}
else
printf("錯誤!\n");
printf("%d-%d=%d\n",a,b,c);
if(c==a-b)
printf("總分為:%d\n",score);
//程式如下,加法 減法各25道
#include
#include
#include
void main()
{
int i,a,b,c,score=0;
srand((unsigned)time(NULL));
for(i=1;i
{ a=rand()%89+10;
b=rand()%89+10;
c=rand()%198;
if(i
{
printf("%d+%d=%d\n",a,b,c);
if(c==a+b)
{printf("正確!\n");
score+=2;
}
else
printf("錯誤!\n");
}
else
{
printf("%d-%d=%d\n",a,b,c);
if(c==a-b)
{printf("正確!\n");
score+=2;
}
else
printf("錯誤!\n");
}
}
printf("總分為:%d\n",score);
}