Advertisement
Josif_tepe

Untitled

Dec 21st, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int n;
  6.     scanf("%d", &n);
  7.    
  8.     int zbir = 0;
  9.     for(int delitel = 1; delitel <= n; delitel++) {
  10.         if(n % delitel == 0) {
  11.             zbir += delitel;
  12.         }
  13.     }
  14.    
  15.     int brojac_na_deliteli = 0;
  16.     for(int delitel = 1; delitel <= zbir; delitel++) {
  17.         if(zbir % delitel == 0) {
  18.             brojac_na_deliteli++;
  19.         }
  20.     }
  21.    
  22.     if(brojac_na_deliteli == 2) {
  23.         printf("PROST\n");
  24.     }
  25.     else {
  26.         printf("SLOZHEN\n");
  27.     }
  28.     return 0;
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement