Advertisement
Josif_tepe

Untitled

Jun 12th, 2021
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <ctype.h>
  3. #include <string.h>
  4. #include <math.h>
  5.  
  6. int rek(char *niza) {
  7.     if(*(niza) == '\0') {
  8.         return 0;
  9.     }
  10.     if(isalpha(*(niza))) {
  11.         if(*(niza + 1) == '\0') {
  12.             return 1;
  13.         }
  14.         return rek(niza + 2) + 1;
  15.     }
  16.     else {
  17.         return rek(niza + 1);
  18.     }
  19. }
  20. int main(int argc, char *argv[]) {
  21.     char niza[10]={'a','e','.','.','E','.','C','A','B','\0'};
  22.     printf("%d\n", rek(niza));
  23.     return 0;
  24. }
  25. /*
  26.  1 0 2 4
  27.  3 3 23 5
  28.  3 5 5 6
  29.  0 3 12 7
  30.  
  31.  
  32.  1 7
  33.  **/
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement