kej

2. Используя таблицу ASCII посчитать количество строчных и з

kej
Feb 18th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     char str[100];
  8.     int l=0;int b=0;
  9.     cin.getline(str, 100);
  10.     for (int i=0;i<100;i++)
  11.     {
  12.         if (str[i] >= 97 && str[i]<=122)
  13.             l++;
  14.         else if (str[i] >= 65 && str[i]<=90)
  15.             b++;
  16.     }
  17.     cout<<"Not capital: "<<l<<endl;
  18.     cout<<"Capital: "<<b<<endl;
  19. }
Add Comment
Please, Sign In to add comment