Advertisement
lukasd

kolokwium 2 zadanie 4

Feb 9th, 2018
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.53 KB | None | 0 0
  1. int funkc(char *arr)
  2. {
  3.     int a = 0;
  4.     if (arr[0] != 9 || arr[0] != 10 || arr[0] != 32)
  5.     {
  6.         a = a + 1;
  7.     }
  8.     for (int i = 0;arr[i]!='\0'; i++)
  9.     {
  10.        
  11.         if ((arr[i] == 9 || arr[i] == 10 || arr[i] == 32)
  12.             &&
  13.             (arr[i+1] != 9 && arr[i+1] != 10 && arr[i+1] != 32 && arr[i+1]!=0))
  14.         {
  15.             a = a + 1;
  16.         }
  17.         if (arr[i] >= 'a' && arr[i] <= 'z')
  18.         {
  19.             arr[i] = arr[i] - 32;
  20.         }
  21.         printf("%c", arr[i]);
  22.     }
  23.     return a;
  24. }
  25. void kolos1()
  26. {
  27.     char arr[]="ala ma kota     ufo przylecialooo z      marsa \0";
  28.    
  29.     printf("%d", funkc(arr));
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement