#include <iostream> using namespace std; int main(int argc, char * argv[]){ for(int n = 1; n <= 35; ++n) if (abs(n%10-3)<=1 && n%100/10!=1) cout << n << " yes\n"; else cout << n << " no\n"; }
Standard input is empty
1 no 2 yes 3 yes 4 yes 5 no 6 no 7 no 8 no 9 no 10 no 11 no 12 no 13 no 14 no 15 no 16 no 17 no 18 no 19 no 20 no 21 no 22 yes 23 yes 24 yes 25 no 26 no 27 no 28 no 29 no 30 no 31 no 32 yes 33 yes 34 yes 35 no
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!