Advertisement
_takumi

num17

Oct 8th, 2020
851
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int cnt = 0, max = 0;
  6.     for (int i = 1017; i <= 7935; i++) {
  7.         if (i % 3 == 0 && i % 7 != 0 && i % 17 != 0 && i % 19 != 0
  8.             && i % 27 != 0) {
  9.             cnt++;
  10.             max = i;
  11.         }
  12.     }
  13.     cout << cnt << endl << max;
  14.    
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement