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);
}
}
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);
}
}
标签:java,Scanner,int,nextInt,sc,打卡,public
From: https://www.cnblogs.com/gyg1222/p/17356436.html