#include <iostream> #include <bits/stdc++.h> using namespace std; bool judge(int x){ if(x%3 == 2 && x%5 == 3 && x%7 == 2){ return true; }else{ return false; } } int main() { for(int i = 1 ;i <= 500 ;i++){ if(judge(i)){ cout << i <<endl; } } return 0; }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account