Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- int main()
- {
- int x;
- ifstream f("produsmaxim.in");
- ofstream g("produsmaxim.out");
- int a,b,c;
- while(f>>x)
- {
- if(x%3==0)
- a=b=c=x/3;
- if(x%3==1)
- c=x/3+1,b=a=x/3;
- if(x%3==2)
- c=x/3+1,b=x/3+1,a=x/3;
- g<<x<<' '<<a<<' '<<b<<' '<<c<<'\n';
- }
- f.close();
- g.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement