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);
- double t0 = scanner.nextDouble();
- double th = scanner.nextDouble();
- double tc = scanner.nextDouble();
- double t = scanner.nextDouble();
- if (t0 > t) {
- System.out.print("cooler ");
- double res = (t0 - t) / tc;
- res *= 100d;
- res = Math.round(res);
- res /= 100d;
- System.out.print(res);
- } else {
- System.out.print("heater ");
- double res = (t - t0) / th;
- res *= 100d;
- res = Math.round(res);
- res /= 100d;
- System.out.print(res);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement