MrGluck
Модератор
7726 / 4762 / 731
Регистрация: 29.11.2010
Сообщений: 13,014
|
28.10.2013, 03:38
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| #include <iostream>
#include <fstream>
#include <clocale>
#include <string>
int main()
{
std::ifstream ifs("input.txt");
if (!ifs) return 1;
setlocale(LC_ALL, "");
std::string s, str = "Подобаний";
while (std::getline(ifs, s))
if (str == s.substr(0, s.find(' ')) )
std::cout << s << std::endl;
} |
|
1
|