img

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt(),b=sc.nextInt();
        int c=sc.nextInt(),d=sc.nextInt();
        int x=a*60+b,y=c*60+d;
        int minutes;
        if(x<y) minutes=y-x;
        else minutes=1440-x+y;
        int h=minutes/60;
        int s=minutes%60;
        System.out.printf("O JOGO DUROU %d HORA(S) E %d MINUTO(S)",h,s);
    }
}

img

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double x = sc.nextDouble();

        if (x <= 2000)
            System.out.println("Isento");
        else if (x <= 3000)
            System.out.printf("R$ %.2f\n", (x - 2000) * 0.08);
        else if (x <= 4500)
            System.out.printf("R$ %.2f\n", (3000 - 2000) * 0.08 + (x - 3000) * 0.18);
        else
            System.out.printf("R$ %.2f\n", (3000 - 2000) * 0.08 + (4500 - 3000) * 0.18 + (x - 4500) * 0.28);
    }
}
posted on 2023-04-26 16:16  许七安gyg  阅读(25)  评论(0)    收藏  举报