#include<stdio.h>
#include<stdlib.h>
#include<time.h>//时间的库函数
int main()
{int i = 0;srand(time(0));//随机种子初始化int num1 = rand() %10;//随机数int num2 = rand() %10;printf("%d * %d = ?\n", num1, num2);printf("请输入答案:");do{scanf("%d", &i);//输入数据if (num1 * num2 == i)printf("答对啦!\n");elseprintf("回答错误,请继续作答\n");} while(num1 * num2 != i);//只有num1*num2==i时才能退出循环return 0;
}