题解 | #3和5和7#
3和5和7
https://ac.nowcoder.com/acm/problem/22192
#include <bits/stdc++.h> using namespace std;
bool func(int n){ if(n%3==2 && n%5==3 && n%7==2) return true; return false;
}
int main() { int n; cin >> n; for(int i=1;i<=n;i++){ if(func(i)) cout << i << endl; } }
查看7道真题和解析