#include"stdio.h"
#include"stdlib.h"
#include"time.h"
void main()
{
int a,b,sum,w=0,y=0;
int i,z;
int
v;
for( i=0;i<10;i++)
{
srand((unsigned)time(NULL));
a=rand()%100+1;
b=rand()%100+1;
v=rand()%3+1;
v=='+'||v=='-'||v=='*'||v=='/';
if(a+b>100)
{
i=i-1;
continue;}
printf("%d %d %d=\t",a,v,b);
scanf("%d",&sum);
if(sum==(a v b))
{{
w++;
y=w*10;
}
if(y>=80)
{
z>0;
continue;
}
else if (y>=60)
{
z>5;
continue;
}
else
{
z<0;
continue;
}
printf("你做对了%d道;!\n",w);
}}
printf("你共得了%d分\n",y);
if(y>=80)
{
z>0;
printf("你很优秀!\n");
}
else if (y>=60)
{
z>5;printf("你及格了!\n");
}
else
{z<0;
printf("你需要努力!\n");
}
}
错误
2
error C2146: 语法错误 : 缺少“)”(在标识符“v”的前面)
d:\my documents\visual studio 2005\projects\1001\1001\1002.cpp
23
错误
3
error C2059: 语法错误 : “)”
d:\my documents\visual studio 2005\projects\1001\1001\1002.cpp
23
错误
4
error C2143: 语法错误 : 缺少“;”(在“{”的前面)
d:\my documents\visual studio 2005\projects\1001\1001\1002.cpp
24