Advertisement
Graf_Rav

Untitled

Jan 11th, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main(){
  7.     setlocale(LC_ALL, "Russian");
  8.  
  9.     string input;
  10.     getline(cin, input);
  11.    
  12.     int symbols = 0;
  13.    
  14.     for(int i = 0; i < input.length(); i++){
  15.         if((input[i] >= 'a' && input[i] <= 'z') || (input[i] >= 'A' && input[i] <= 'Z')){
  16.             cout<<"_";
  17.             symbols++;
  18.         }
  19.         else{
  20.             cout<<' ';
  21.         }
  22.     }
  23.    
  24.     cout<<"\nКоличество латинских букв "<<symbols;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement