Advertisement
Josif_tepe

Untitled

Dec 29th, 2023
1,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int n = 28;
  5.     int k = 4;
  6.     int broj_na_deliteli_na_n = 0;
  7.     for(int i = 1; i <= n; i += 1) {
  8.         if(n % i == 0) {
  9.             broj_na_deliteli_na_n += 1;
  10.         }
  11.     }
  12.     int ok = 1;
  13.     for(int i = n - 1; i >= n - k; i -= 1) {
  14.        
  15.         int deliteli_na_i = 0;
  16.         for(int j = 1; j <= i; j += 1) {
  17.             if(i % j == 0) {
  18.                 deliteli_na_i += 1;
  19.             }
  20.         }
  21.         if(broj_na_deliteli_na_n <= deliteli_na_i) {
  22.             ok = 0;
  23.         }
  24.     }
  25.     if(ok == 1) {
  26.         cout << "DA" << endl;
  27.     }
  28.     else {
  29.         cout << "NE" << endl;
  30.     }
  31.     return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement