Advertisement
JOHNYTHEWINNER

PIN codes

Feb 29th, 2020
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. # include <iostream>
  2. using namespace std;
  3. #include <iomanip>
  4. #include <math.h>
  5. #include <cmath>
  6. #include <string>
  7.  
  8. int main()
  9. {
  10.     int upborderoffirst;
  11.     int upborderofsecond;
  12.     int upborderofthird;
  13.     cin >> upborderoffirst;
  14.     cin >> upborderofsecond;
  15.     cin >> upborderofthird;
  16.     int one = 1;
  17.     int two = 1;
  18.     int three = 1;
  19.     for (int one = 1; one <= upborderoffirst; one++) {
  20.         for (int two = 2; two <= upborderofsecond; two++) {
  21.             bool isprime = true;
  22.             for (int n = 2; n < two; n++) {
  23.                 if (two % n == 0) {
  24.                     isprime = false;
  25.                 }
  26.             }
  27.             for (int three = 1; three <= upborderofthird; three++) {
  28.                 if (one % 2 == 0 && isprime == true && three % 2 == 0) {
  29.                     cout << one << " " << two << " " << three << endl;
  30.                 }
  31.             }
  32.         }
  33.     }
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement