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