Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. string toString(int x) {
  6. if (x < 10) {
  7. return string() + (char) (x + '0');
  8. }
  9. return "10";
  10. }
  11.  
  12. int main() {
  13. for (int i = 1; i <= 10; i++) {
  14. ifstream input("input" + toString(i) + ".txt");
  15. ofstream output("output" + toString(i) + ".txt");
  16.  
  17. int x;
  18. input >> x;
  19. output << x << endl;
  20.  
  21. input.close();
  22. output.close();
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement