Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106763 6张轶涵 猜数字 C++ Accepted 6 MS 268 KB 375 2025-01-16 16:15:36

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; bool f; int main() { int a,b,c; int n; cin>>n; while(n--) { cin>>a>>b>>c; for(int i=1000;i<=9999;i++) { if(i % a == 0&&(i+1) % b == 0&&(i+2) % c == 0) { cout<<i<<endl; f=true; break; } } if(f==false) { cout<<"Impossible"<<endl; } f=false; } return 0; }