一、源码
运行环境:Dev C++ 5.11
#include <bits/stdc++.h>
using namespace std;
struct question
{
long long first;
long long second;
}
t[1000001];
int main()
{
long long Min, Max, add, minus, x = time(0) % 100, y = time(0) % 88;
cout << "加法数量:";
cin >> add;
cout << "减法数量:";
cin >> minus;
cout << "MIN:";
cin >> Min;
cout << "MAX:";
cin >> Max;
for (int i = 1; i <= add; i++)
{
srand((time(0) + x + y + i) % 222);
x += rand() % Max;
srand((time(0) + x + add) % 111);
y += rand() % Max;
if (x > Max) x -= Max;
if (y > Max) y -= Max;
while (x + y > Max)
{
x -= rand() % x;
y -= rand() % y;
}
t[i].first = x;
t[i].second = y;
}
for (int i = 1; i <= minus; i++)
{
srand((time(0) + x + y + i) % 222);
x += rand() % Max;
srand((time(0) + x + minus) % 111);
y += rand() % Max;
if (x > Max) x -= Max;
if (y > Max) y -= Max;
t[i + add].f
C++实现的随机加减法练习题生成器,

本文介绍了一个使用C++编写的程序,用于生成包含指定数量加法和减法题目的练习文档,包括题目数量、范围限制和时间要求。
最低0.47元/天 解锁文章
1771

被折叠的 条评论
为什么被折叠?



