Advertisement
Josif_tepe

Untitled

Mar 29th, 2022
1,999
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4.  
  5. int main() {
  6.    
  7.     int x;
  8.     scanf("%d", &x);
  9.    
  10.     int brojac = 0;
  11.     for(int i = 1; i <= x; i += 1) {
  12.         if(x % i == 0) {
  13.             brojac += 1;
  14.         }
  15.     }
  16.     if(brojac > 2) {
  17.         printf("SLOZEN BROJ\n");
  18.     }
  19.     else {
  20.         printf("PROST BROJ\n");
  21.     }
  22.    
  23.     return 0;
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement