Advertisement
Josif_tepe

Untitled

Nov 5th, 2024
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n;
  6.     cin >> n;
  7.    
  8.     int broj_na_deliteli = 0;
  9.     for(int i = 1; i <= n; i++) {
  10.         if(n % i == 0) {
  11.             broj_na_deliteli++;
  12.         }
  13.     }
  14.     if(broj_na_deliteli == 2) {
  15.         cout << "PROST BROJ" << endl;
  16.     }
  17.     else {
  18.         cout << "SLOZHEN BROJ" << endl;
  19.     }
  20.    
  21.    
  22.    
  23.    
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement