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