Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
72657 sh25_zhuwy 判断能否被3,5,7整除 C++ 通过 0 MS 248 KB 538 2025-11-02 13:43:07

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; bool x,y,z; x=(a%3==0); y=(a%5==0); z=(a%7==0); int j=x,k=y,l=z; if(j+k+l==1) { if (x) { cout<<"3"; } if(y) { cout<<"5"; } if(z) { cout<<"7"; } } else { if (x) { cout<<"3"; } if(y) { cout<<" 5"; } if(z) { cout<<" 7"; } } if(j+k+l==0) { cout<<"n"; } return 0; }


测评信息: