Advertisement
Josif_tepe

Untitled

Aug 20th, 2023
1,041
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(int argc, const char * argv[]) {
  4.    
  5.     int a, b;
  6.     scanf("%d%d", &a, &b);
  7.    
  8.     for(int i = a; i <= b; i++) {
  9.         int pom = i;
  10.         int broj_na_deliteli = 0;
  11.        
  12.         for(int j = 1; j <= pom; j++) {
  13.             if(pom % j == 0) {
  14.                 broj_na_deliteli++;
  15.             }
  16.         }
  17.         if(broj_na_deliteli == 2) {
  18.             printf("PROST ");
  19.         }
  20.         else {
  21.             printf("SLOZEN ");
  22.         }
  23.     }
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement