Advertisement
Kentoo

E#6

Jan 16th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <string>
  4. #include <locale>
  5.  
  6. using namespace std;
  7.  
  8. void main()
  9. {
  10.     setlocale(LC_ALL, "Russian");
  11.     string str = "Добро пожаловать в мой дом - как жаль, что я вам не очень рад";
  12.     if (str.substr(0, str.find(" - ")).length() > str.substr(str.find(" - ") + 3).length()) {
  13.         cout << "Первая часть больше" << endl;
  14.     }
  15.     else {
  16.         cout << "Вторая часть больше" << endl;
  17.     }
  18.     system("pause");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement