Created
January 20, 2012 13:46
-
-
Save hhc0null/1647441 to your computer and use it in GitHub Desktop.
aoj-0006-Reverse_Sequence.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
both my legs itch... | |
help... | |
by the way, is my english sure? | |
*/ | |
#include <iostream> | |
#include <iomanip> | |
#include <cstdio> | |
#include <stack> | |
using namespace std; | |
int main() { | |
char buff; // buffer of char type | |
stack<char> ch_stck; // stack of char type | |
for(;cin >> buff;) { | |
ch_stck.push(buff); // push a character into stack | |
} | |
for(;!ch_stck.empty();) { | |
cout << ch_stck.top() << flush; // output characters from stack (from top to bottom) | |
ch_stck.pop(); // pop the top of stack | |
} | |
cout << endl; // output LF | |
return 0; | |
} |
include
include
include
最初が消えました;
いろいろやってみましたが, そのコード動きませんでした… > yutopp
すみません;
std::copy( s.rbegin(), s.rend(), std::ostream_iterator( std::cout, "" ) );
が
std::copy( s.rbegin(), s.rend(), std::ostream_iterator( std::cout, "" ) );
ですね。
gistさんがわざわざ綺麗に<>を消してくれていました。
把握です
ありがとうございます♪
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
include
include
include
int main() {
std::string s;
std::cin >> s;
std::copy( s.rbegin(), s.rend(), std::ostream_iterator( std::cout, "" ) );
}
こういうことですか?