Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
28469 | lnx | 判断能否被3,5,7整除 | C++ | Wrong Answer | 0 MS | 252 KB | 497 | 2023-10-14 19:01:22 |
#include<iostream> using namespace std; int main() { int N,a,b,c; cin>>N; a=N%3; b=N%5; c=N%7; if (a==0&&b==0&&c==0) { cout<<"3 5 7"; } if (a!=0&&b==0&&c==0) { cout<<"5 7"; } if (a==0&&b!=0&&c==0) { cout<<"3 7"; } if (a==0&&b==0&&c!=0) { cout<<"3 5"; } if (a==0&&b!=0&&c!=0) { cout<<"3"; } if (a!=0&&b==0&&c!=0) { cout<<"5"; } if (a!=0&&b!=0&&c==0) { cout<<"7"; } else { cout<<"n"; } return 0; }