- 判断能否被3,5,7整除
key
- @ 2025-7-17 13:12:54
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
if(n%3==0 and n%5==0 and n%7==0){
cout<<"3 5 7";
}
else if(n%3==0 and n%5==0){
cout<<"3 5";
}
else if(n%3==0 and n%7==0){
cout<<"3 7";
}
else if(n%5==0 and n%7==0){
cout<<"5 7";
}
else if(n%3==0){
cout<<"3";
}
else if(n%7==0){
cout<<"7";
}
else if(n%5==0){
cout<<"5";
}
else{
cout<<"n";
}
return 0;
}
0 条评论
目前还没有评论...
信息
- ID
- 51
- 时间
- ms
- 内存
- MiB
- 难度
- 5
- 标签
- 递交数
- 230
- 已通过
- 89
- 上传者