Advertisement
a53

ProdusMaxim

a53
Mar 8th, 2018
136
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 x;
  7. ifstream f("produsmaxim.in");
  8. ofstream g("produsmaxim.out");
  9. int a,b,c;
  10. while(f>>x)
  11. {
  12. if(x%3==0)
  13. a=b=c=x/3;
  14. if(x%3==1)
  15. c=x/3+1,b=a=x/3;
  16. if(x%3==2)
  17. c=x/3+1,b=x/3+1,a=x/3;
  18. g<<x<<' '<<a<<' '<<b<<' '<<c<<'\n';
  19. }
  20. f.close();
  21. g.close();
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement