今天上了java课,学会了好多东西,先写一下课堂测试吧
就是随机写30道题目给小学生,两位数加减乘除
#include<iostream>
using namespace std;
#include<time.h>
#include<cstdlib>
int main()
{
srand((unsigned)time(NULL));
int a, b, c;
string m = "+-*/";
for (int i = 0; i < 30; i++)
{
a = rand() % 100 + 1;
b = rand() % 100 + 1;
c = rand() % 4;
cout << a << m[c] << b << "=" << endl;
}
}