Advertisement
noshin98

uva 494

Jul 14th, 2016
378
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. int main()
  3. {
  4.     char name[1000];
  5.     int i,p;
  6.     while(gets(name))
  7.  
  8. {
  9. p=0;
  10. for(i=0;name[i]!='\0';i++)
  11. {
  12.     if(
  13.           ((name[i]>='a'&& name[i]<='z')||
  14.           (name[i]>='A' && name[i]<='Z'))
  15.           &&
  16.           (name[i+1]<'a' || name[i+1]>'z') &&
  17.            (name[i+1]<'A' || name[i+1]>'Z')
  18.       )
  19.           p++;
  20.       }
  21.       printf("%d\n",p);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement