Advertisement
rengetsu

ProcedurProgramavimas_3.12

May 21st, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4.  
  5. using namespace std;
  6.  
  7. string str;
  8. int len, i=0;
  9. char tt[1000];
  10.  
  11. ifstream fin("input.txt");
  12. ofstream fout("o.txt");
  13.  
  14. void funkc()
  15. {
  16.     if(i<len)
  17.     {
  18.         i++;
  19.         fout<<tt[len-i]<<endl;
  20.         funkc();
  21.     }
  22. }
  23.  
  24. int main()
  25. {
  26.     fin>>str;
  27.     strcpy(tt, str.c_str());
  28.     len=str.length();
  29.     funkc();
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement