| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 136256 | 彭士宝 | 算式问题 | C++ | Wrong Answer | 1 MS | 260 KB | 1224 | 2025-11-09 22:47:47 |
#include <iostream> #include <vector> #include <string> using namespace std; bool check(int ab, int cde, int &fgh, int &ijk, int &lmn, int &opqrst) { int c = cde / 100; // C int d = (cde / 10) % 10; // D int e = cde % 10; // E fgh = ab * e; // FGH = AB * E ijk = ab * d; // IJK = AB * D lmn = ab * c; // LMN = AB * C opqrst = fgh + ijk * 10 + lmn * 100; // OPQRST = FGH + IJK*10 + LMN*100 // 检查 FGH、IJK、LMN 是否都是三位数 if (fgh < 100 || ijk < 100 || lmn < 100) return false; // 检查 OPQRST 是否是一个六位数 if (opqrst < 100000 || opqrst > 999999) return false; return true; } int main() { for (int ab = 10; ab <= 99; ++ab) { for (int cde = 1000; cde <= 9999; ++cde) { int fgh, ijk, lmn, opqrst; if (check(ab, cde, fgh, ijk, lmn, opqrst)) { cout << ab << endl; // 输出 AB cout << cde << endl; // 输出 CDE cout << fgh << endl; // 输出 FGH cout << ijk << endl; // 输出 IJK cout << lmn << endl; // 输出 LMN return 0; } } } return 0; }
------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-----
12 8399 108 108 996