Advertisement
Josif_tepe

Untitled

Mar 27th, 2024
704
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.  
  3. int main() {
  4.         int n;
  5.         scanf("%d", &n);
  6.  
  7.         int niza[n];
  8.  
  9.         for(int i = 0; i < n; i++) {
  10.             scanf("%d", &niza[i]);
  11.         }
  12.    
  13.     for(int i = 0; i < n; i++) {
  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.  
  21.         if(broj_na_deliteli <= 2) {
  22.             printf("Brojot %d e PROST\n", niza[i]);
  23.         }
  24.         else {
  25.             printf("Brojot %d e SLOZHEN\n", niza[i]);
  26.         }
  27.     }
  28.       return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement