Advertisement
Josif_tepe

Untitled

Nov 12th, 2023
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5. #include <math.h>
  6.  
  7. void f(int broj, char c) {
  8.     if(broj == 0) {
  9.         return;
  10.     }
  11.     for(int i = 0; i < broj; i++) {
  12.         printf("%c ", c);
  13.     }
  14.     f(broj - 1, c - 1);
  15. }
  16.  
  17. int main(int argc, char * argv[]) {
  18.     int broj;
  19.     char c;
  20.     scanf("%d", &broj);
  21.     scanf(" %c", &c);
  22.    
  23.     printf("%d %c\n", broj, c);
  24.     f(broj, c);
  25.    
  26.     return 0;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement