@Konstantin_D
14 / 14 / 2
Регистрация: 21.07.2011
Сообщений: 89
|
04.03.2012, 17:19
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| #include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
string str("HOW DO YOU DO");
string word1, word2, outstr;
istringstream iss(str);
while ( iss >> word1 >> word2 )
{
outstr += string(word2.rbegin(), word2.rend());
outstr.push_back(' ');
}
outstr.erase(outstr.end()-1);
cout << outstr << endl;
} |
|
0
|