Run ID:65773

提交时间:2024-02-09 22:06:11

#include <iostream> using namespace std; // 生成被除数、除数、商和余数 void generateNumbers() { int dividend = 1000 + (rand() % 900); // 生成四位数的被除数 int divisor = 10 + (rand() % 90); // 生成两位数的除数 int quotient = 809; int remainder = 1; cout << "被除数: " << dividend << endl; cout << "除数: " << divisor << endl; cout << "商: " << quotient << endl; cout << "余数: " << remainder << endl; } int main() { srand(time(0)); // 初始化随机数生成器 generateNumbers(); // 调用函数生成算式 return 0; }