返回列表 發帖
  1. import java.util.Scanner;

  2. public class JPD05
  3. {
  4.     public static void main (String[] args) throws java.lang.Exception
  5.     {
  6.      for(int i = 0;i <100;i++) {
  7.         double h1 = new Scanner(System.in).nextInt();  
  8.         double x1= new Scanner(System.in).nextInt();  
  9.         if(x1== 1)  {  
  10.           System.out.printf("%.1f",(long)(h1-80 )*0.7);  
  11.             System.out.println();
  12.          }  
  13.         if(x1== 2){  
  14.           System.out.printf("%.1f",(long)(h1-70)*0.6);  
  15.             System.out.println();
  16.         }
  17.        }
  18.     }
  19. }
複製代碼

TOP

返回列表