Advertisement
Josif_tepe

Untitled

Aug 21st, 2023
580
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.48 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, c;
  6.     scanf("%d%d%d", &a, &b, &c);
  7.    
  8.     for(int i = a; i <= b; i++) {
  9.         int pom = i;
  10.         int broj_na_deliteli = 0;
  11.         for(int j = 1; j <= pom; j++) {
  12.             if(pom % j == 0) {
  13.                 broj_na_deliteli++;
  14.             }
  15.         }
  16.        
  17.         if(broj_na_deliteli == c) {
  18.             printf("%d ", i);
  19.         }
  20.     }
  21.     return 0;
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement