- import java.util.Scanner;
- public class JPD05
- {
- public static void main (String[] args) throws java.lang.Exception
- {
- for(int i = 0;i <100;i++) {
- double h1 = new Scanner(System.in).nextInt();
- double x1= new Scanner(System.in).nextInt();
- if(x1== 1) {
- System.out.printf("%.1f",(long)(h1-80 )*0.7);
- System.out.println();
- }
- if(x1== 2){
- System.out.printf("%.1f",(long)(h1-70)*0.6);
- System.out.println();
- }
- }
- }
- }
複製代碼 |