0分求助!
查看原帖
0分求助!
807775
xiang0605楼主2022/11/26 11:17

打到手都断了居然WA了!各位大佬帮看一看!

#include <iostream>
using namespace std;

int main()
{
    int x; 
    cin >> x;
    if (x % 3 == 0 && x % 5 == 0 && x % 7 == 0) cout << "3 5 7" << " ";
    if (x % 3 == 0 && x % 5 == 0) cout << "3 5" << " ";
    if (x % 3 == 0 && x % 7 == 0) cout << "3 7" << " ";
    if (x % 5 == 0 && x % 7 == 0) cout << "5 7" << " ";
    if (x % 3 == 0) cout << "3" << " ";
    if (x % 5 == 0) cout << "5" << " ";
    if (x % 7 == 0) cout << "7" << " ";
    if (x % 3 != 0 && x % 5 != 0 && x % 7 != 0) cout << "n" << " ";
    return 0;
}

qwq

2022/11/26 11:17
加载中...