Advertisement
Josif_tepe

Untitled

Jan 26th, 2025
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.    
  9.     int brojac = 0;
  10.    
  11.     for(int i = 1; i <= n; i++) {
  12.         if(n % i == 0) {
  13.             brojac++;
  14.             cout << i << " ";
  15.         }
  16.     }
  17.     if(brojac == 2) {
  18.         cout << "prost" << endl;
  19.     }
  20.     else {
  21.         cout << "slozhen" << endl;
  22.     }
  23.     return 0;
  24. }
  25. /*
  26.  rek(1234) = rek(123) + 4 = 2 + 4 = 6
  27.  rek(123) = rek(12) = 2
  28.  rek(12) = rek(1) + 2 = 0 + 2 = 2
  29.  rek(1) = rek(0) = 0
  30.  rek(0) = 0
  31.  
  32.  **/
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement