Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- int days;
- cin >> days;
- double currentLiters, currentGradus, averageGradus = 0, totalLiters = 0;
- for (int i = 0; i < days; i++) {
- cin >> currentLiters >> currentGradus;
- averageGradus += currentLiters * currentGradus;
- totalLiters += currentLiters;
- }
- averageGradus /= totalLiters;
- cout << fixed << setprecision(2)
- << "Liter: " << totalLiters << endl
- << "Degrees: " << averageGradus << endl;
- if (averageGradus < 38) {
- cout << "Not good, you should baking!\n";
- }
- else if (averageGradus > 42) {
- cout << "Dilution with distilled water!\n";
- }
- else {
- cout << "Super!\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement