fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void rev_out(istream& is){
  5. char a;
  6. if (is >> a) {
  7. rev_out(is);
  8. cout << a;
  9. }
  10. }
  11.  
  12. int main() {
  13. rev_out(cin);
  14. return 0;
  15. }
Success #stdin #stdout 0s 3344KB
stdin
abcdefg
stdout
gfedcba