思路
,先输入,然后分别去看能不能出、、,如果能,就输出能整出的一个或多个数,否则就不输出。
代码
#include<bits/stdc++.h>
using namespace std;
int n,f;
int main(void)
{
cin >> n;
if(n % 3 == 0)
{
cout << "3 ";
f = 1;
}
if(n % 5 == 0)
{
cout << "5 ";
f = 1;
}
if(n % 7 == 0)
{
cout << "7 ";
f = 1;
}
if(!f)
{
cout << n << endl;
}
return 0;
}