Two variables must be read from the standard stream: int and string. The input is separated by the end-of-line character, the variable string probably contains spaces. I would like to avoid clumsy view code:
int i; string s; cin >> i; //перед считыванием строки приходится хавать символ конца строки cin.get(); //считываем строку полностью (возможно, сторока содержит пробелы) getline(cin, s); I would like to solve elegantly, like:
int i; string s; cin >> i >> s; but, apparently, before this somehow you need to configure the cin object. Tell me how to make beautiful, scanf is not welcome.