Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109862 | 胡海峰老师 | 猜数字 | C++ | Accepted | 5 MS | 264 KB | 459 | 2025-02-13 10:01:01 |
#include <iostream> using namespace std; int main(){ //25 56 3 int a,b,c,flag; int n; cin>>n; for( int i=1;i<=n;i++) { cin>>a>>b>>c; flag =0; for(int x=1000 ; x<=9999;x++) { if(x%a==0 && (x+1)%b==0 && (x+2)%c==0) { cout<<x<<endl; flag =1; break; } } if(flag==0) cout<<"Impossible"<<endl; } return 0; } /* Input 2 44 38 49 25 56 3 Output Impossible 2575 */