12.c
来自「C语言算法举例.rar」· C语言 代码 · 共 24 行
C
24 行
# include "stdlib.h"
main( )
{
int a ,b , c , x=0;
while (x<5)
{
a=rand( )%100 ;
b=rand( )%100 ;
if (a+b >100)
continue;
printf("\n%d+%d=? ",a,b) ;
scanf ("%d",&c);
if (c= =a+b)
{ printf("The answer is rignt ");
x++;
}
else
{ printf( " The answer is wrong!");
x=0;
}
}
printf("\n Program is over.");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?