题解 | #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; } }

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务