Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
112577 彭士宝 算式问题 C++ Wrong Answer 1 MS 260 KB 1044 2025-03-09 16:16:25

Tests(0/1):


Code:

#include <iostream> using namespace std; int main() { // 穷举所有可能的数字组合 for (int num1 = 10; num1 < 100; ++num1) { // 两位数 for (int num2 = 1000; num2 < 10000; ++num2) { // 四位数 for (int num3 = 10; num3 < 100; ++num3) { // 两位数 for (int num4 = 100; num4 < 1000; ++num4) { // 三位数 for (int num5 = 100; num5 < 1000; ++num5) { // 三位数 // 假设算式是 num1 * num2 = num3 * num4 + num5 if (num1 * num2 == num3 * num4 + num5) { cout << num1 << endl; cout << num2 << endl; cout << num3 << endl; cout << num4 << endl; cout << num5 << endl; return 0; // 找到唯一解后退出程序 } } } } } } return 0; }


Run Info:

------Input------
#include void fun() { int a,b,c,d; for(a = 10;a < 100;a++){ b = a*8; c = a*9; d = b*100 + c + 1; if(b>=10 && b<100 && c>=100 && c < 1000 && d>=1000 && d<10000) { printf("%d\n",a); printf("%d\n",d); printf("%d\n",b); printf("%d\n",c+1); printf("%d\n",c); return; } } } void main() { fun(); }
------Answer-----
12 9709 96 109 108
------Your output-----
10 1000 10 901 990