Advertisement
Istanvir389

Performance test 3

Oct 18th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.  
  5.     int i,j,n,alphabet=0,capital=0,small=0;
  6.     scanf("%d",&n);
  7.  
  8.    for(i=0 ;i<n ; i++)
  9.    {
  10.   char ibr[400];
  11.        scanf(" %[^\n]",ibr);
  12.  
  13.        for(j=0 ;j<strlen(ibr); j++)
  14.        {
  15.            if(ibr[j]>='A' && ibr[j]<='Z' || ibr[j]>='a' && ibr[j]<='z')
  16.            {
  17.  
  18.            alphabet++;
  19.             if(ibr[j]>='a') small++;
  20.                          else capital++;
  21.  
  22.                          }
  23.        }
  24.        printf("Alphabet :%d\n ",alphabet);
  25.        printf("Capital :%d\n",capital);
  26.      printf("Small:%d\n",small);
  27.   alphabet=0,capital=0,small=0;
  28.    }
  29.  
  30.  
  31.     return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement