Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream fin("produsmaxim.in");
- ofstream fout("produsmaxim.out");
- int n;
- while (fin >> n) {
- int a, b, c; // a = b = c => 100% produsul maxim
- a = b = c = n/3; // le am pus pe toate = n / 3, 7 /3, adica 2
- b = (n - a) / 2;
- c = n - b - a;
- fout << n <<" " << a << " "<< b << " " << c << "\n"; // aparent \n e mai rapid decat << endl....
- }
- fin.close();
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment