Advertisement
TwiNNeR

Kolku zborovi pochnuvaat i zavrshuvaat na ista bukva

Oct 26th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5.  
  6. int main()
  7. {
  8.  
  9.     char vlez[100];
  10.  
  11.     int i=0;
  12.     int j=0;
  13.     int brojach=0;
  14.     for(i=0;1;i=j,j++)
  15.     {
  16.  
  17.         while((vlez[j]=getchar())!=' ')
  18.         {
  19.             if(vlez[j]=='.') break;
  20.             j++;
  21.         }
  22.         if(vlez[i]==vlez[j]) brojach++;
  23.  
  24.         if(vlez[j]=='.') break;
  25.     }
  26.     printf("%d",brojach);
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement