s
2024-04-13 19:49:35
发布于:浙江
2阅读
0回复
0点赞
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
if(n % 3 == 0 && n % 5 == 0 && n % 7 == 0){
cout << "3" << " " << "5" << " " << "7";
}else if(n % 3 == 0 && n % 5 == 0 || n % 7 == 0 && n % 5 == 0 || n % 3 == 0 && n % 7 == 0){
if(n % 3 == 0 && n % 5 == 0){
cout << "3" << " " << "5";
}else if(n % 3 == 0 && n % 7 == 0){
cout << "3" << " " << "7";
}else if(n % 5 == 0 && n % 7 == 0){
cout << "5" << " " << "7";
}
}else if(n % 3 == 0 || n % 5 == 0 || n % 7 == 0){
if(n % 3 == 0){
cout << "3";
}else if(n % 7 == 0){
cout << "7";
}else if(n % 5 == 0){
cout << "5";
}
}else if(n % 3 != 0 && n % 5 != 0 && n % 7 != 0){
cout << "n";
}
return 0;
}
这里空空如也
有帮助,赞一个