心算游戏

图片[1]-心算游戏-云港网络

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int x,a,b,c;
	bool y;
	cin>>x;
	for (int i=0;i<x;i++)
	{
		srand(time(0));
		a=rand()%90+10;
		b=rand()%90+10;
		cout << a << "+" << b << "=";
		cin >> c;
		if (c==a+b) y=1;
		else y=0;
		switch(y)
		{
			case 1:cout << "正确!" <<endl;break;				
			case 0:cout << "错误!" <<endl;break;		
		}
	} 
	return 0;
}
© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
shenyutong的头像-云港网络
相关推荐
评论 抢沙发

请登录后发表评论

    暂无评论内容