题解
2025-11-30 09:36:01
发布于:上海
0阅读
0回复
0点赞
#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 % 5 == 0 and n % 7 == 0 ) {
cout << "5 7";
} else if ( n % 3 == 0 and n % 7 == 0 ) {
cout << "3 7";
} else if ( n % 3 == 0 ) {
cout << "3";
} else if ( n % 5 == 0 ) {
cout << "5";
} else if ( n % 7 == 0 ) {
cout << "7";
} else cout << "n";
return 0;
}
这里空空如也







有帮助,赞一个