嗯就是有些麻烦
2024-02-06 16:00:52
发布于:浙江
12阅读
0回复
0点赞
#include <iostream>
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)
{
cout << "3" << " " << "5";
}
else if (n%3 == 0 && n%7 == 0)
{
cout << "3" << " " << "7";
}
else if (n%7 == 0 && n%5 == 0)
{
cout << "5" << " " << "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;
}
这里空空如也
有帮助,赞一个