C/C++の宿題を片付けます 57代目
■ このスレッドは過去ログ倉庫に格納されています
0074デフォルトの名無しさん
2006/01/10(火) 23:09:51意地悪してみた。VC6では無理かもしれない。
#include <iostream>
#include <sstream>
#include <string>
#include <iterator>
#include <altorithm>
int main()
{
using namespace std;
int n;
cin >> n;
ostringstream oss;
oss << n;
string str = oss.str();
ostream_iterator<char> osit(cout, " ");
copy(str.begin(), str.end(), osit);
cout << '\n';
copy(str.rbegin(), str.rend(), osit);
cout << endl;
}
■ このスレッドは過去ログ倉庫に格納されています