Guest User

Untitled

a guest
Sep 18th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <cstring>
  5. #define MAXLEN 200
  6. #define Alpha 26
  7.  
  8. using namespace std;
  9.  
  10.  
  11. char S1[MAXLEN], S2[Alpha];
  12. int i=0,j=0,counter=0, alphacounter=0;
  13. char c;
  14.  
  15.  
  16.  
  17. int main()
  18. {
  19.    
  20.    
  21.    
  22.    
  23.    
  24.     S1[i]=cin.get();
  25.    
  26.     while (S1[i] != '.')
  27.     {
  28.        
  29.        
  30.        
  31.        
  32.        
  33.        
  34.        
  35.         if ((S1[i] >='a' && S1[i]<='z') || (S1[i] >='A' && S1[i]<='Z') ){
  36.             if (alphacounter != 27)
  37.                 alphacounter++;}
  38.    
  39.    
  40.    
  41.         counter++;
  42.         i++;
  43.         S1[i]=cin.get();
  44.     }
  45.    
  46.    
  47.     cout << "Characters Entered : " << counter;
  48.     cout << endl;
  49.     cout << "Alphabetical Characters : " << alphacounter;
  50.    
  51.    
  52.     return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment