Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123043 mjw1 算式问题 C++ Accepted 3 MS 268 KB 659 2025-06-22 16:16:42

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int sum(int a) { int cnt = 0; while(a != 0) { a /= 10; cnt++; } return cnt; } int main() { for(int i = 1000;i <= 9999;i++) { for(int j = 10;j <= 99;j++) { int a = i / 100; if(a / j == 8 and sum(8 * j) == 2) { int b = i - j * 800; int c = b; b /= 10; if(b / j == 0 and sum(b) == 2) { if(c / j == 9 and c % j == 1 and sum(c) == 3 and sum(c - 1) == 3) { cout << j << endl; cout << i << endl; cout << 8 * j << endl; cout << c << endl; cout << c - 1 << endl; } } } } } return 0; }