Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
147980 王峻熙 猜数字 C++ Accepted 5 MS 268 KB 527 2026-02-09 09:46:19

Tests(1/1):


Code:

#include <iostream> using namespace std; int main() { int c; cin >> c; for (int i = 0; i < c; i++) { int a, b, c; cin >> a >> b >> c; int found = 0; for (int x = 1000; x <= 9999; x++) { if (x % a == 0 && (x + 1) % b == 0 && (x + 2) % c == 0) { cout << x << endl; found = 1; break; } } if (!found) { cout << "Impossible" << endl; } } return 0; }