Advertisement
Bualrond

Untitled

Feb 7th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define FOR(i, k, n) for(int i = (k); i < (n); i++)
  6. #define DFOR(i, k, n) for(int i = (k); i > (n); i--)
  7. #define SZ(a) int((a).size())
  8. #define FA(i, v) FOR(i, 0, SZ(v))
  9. #define RFA(i, v) DFOR(i, SZ(v), 0)
  10.  
  11. #define ll long long
  12. #define endl '\n'
  13.  
  14. #define MAX_INT 2147483647
  15.  
  16. #define fi first
  17. #define se second
  18.  
  19. #define fo(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
  20. #define fstd {freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);}
  21.  
  22. string st = "0123456789";
  23.  
  24. string toString(int a){
  25.     string out = "";
  26.     while(a){
  27.         out = st[a % 10] + out;
  28.         a /= 10;
  29.     }
  30.     return out;
  31. }
  32.  
  33. int main()
  34. {
  35.     ifstream inp;
  36.     string p;
  37.     FOR(i, 1, 4){
  38.         inp.open(toString(i) + ".txt");
  39.         inp >> p;
  40.         cout << p << '\n';
  41.         inp.close();
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement