Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int days = Integer.parseInt(scanner.nextLine());
- double currentLiters, currentGradus, averageGradus = 0, totalLiters = 0;
- for (int i = 0; i < days; i++) {
- currentLiters = Double.parseDouble(scanner.nextLine());
- currentGradus = Double.parseDouble(scanner.nextLine());
- averageGradus += currentLiters * currentGradus;
- totalLiters += currentLiters;
- }
- averageGradus /= totalLiters;
- System.out.printf("Liter: %.2f\nDegrees: %.2f\n", totalLiters, averageGradus);
- if (averageGradus < 38) {
- System.out.println("Not good, you should baking!");
- } else if (averageGradus > 42) {
- System.out.println("Dilution with distilled water!");
- } else {
- System.out.println("Super!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement