#include
#include
#include
main()
{
int i,n[4];
for( i = 0; i < 20;i++ )
{
srand( time(NULL) );
n[0]=rand()%10;
n[1]=rand()%10;
n[2]=n[1]+n[0];
loop:
printf("%d+%d=",n[0],n[1]);
scanf("%d",&n[3]);
if(n[3]==n[2])
{
printf( "right!\n" );
}
else
{
printf( " error!\n重新输入" );
goto loop;
}
}
}