Advertisement
Josif_tepe

Untitled

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