Advertisement
a53

cod24

a53
Aug 26th, 2020
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. #include <fstream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. ifstream f("cod24.in");
  8. f>>n;
  9. f.close();
  10. int cm=n/1000;
  11. if(cm<9)
  12. ++cm;
  13. int cs=n%1000/100;
  14. if(cs<9)
  15. ++cs;
  16. int cz=n%100/10;
  17. if(cz<9)
  18. ++cz;
  19. int cu=n%10;
  20. if(cu<9)
  21. ++cu;
  22. ofstream g("cod24.out");
  23. g<<cm*1000+cs*100+cu*10+cz<<'\n';
  24. g.close();
  25. return 0;
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement