@CyBOSSeR
2307 / 1680 / 86
Регистрация: 06.03.2009
Сообщений: 3,675
|
12.12.2010, 17:27
|
|
C++ | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| #include <iostream>
#include <string>
#include <boost/lexical_cast.hpp>
int Transform(int n) {
std::string s = boost::lexical_cast<std::string>(n);
std::swap(s[0], s[s.length() - 1]);
return boost::lexical_cast<int>(s);
}
int main() {
std::cout << Transform(12345) << std::endl;
return 0;
} |
|
Результат: http://liveworkspace.org/code/ad8fc1d8a85923d6c8e8dd17289cb410
0
|