import java.util.Scanner;
public class rate {
public static void main(String[] args)
{
System.out.print("請輸入行駛的公裡數:");
int j;
for (j = 1;; j++) {
Scanner cin = new Scanner(System.in);
int a = cin.nextInt();
if (a == 100) {
System.out.println("100公裡的養路費為162.5元");
} else {
int b = a / 25;
int c = 0;
float d;
switch (b) {
case 0:
c = a * 10;
d = (float) (c / 10.0);
System.out.println(a + "公裡的養路費為" + d + "元");
break;
case 1:
c = 25 * 10 + (a - 25) * 15;
d = (float) (c / 10.0);
System.out.println(a + "公裡的養路費為" + d + "元");
break;
case 2:
c = 25 * 10 + 25 * 15 + (a - 50) * 20;
d = (float) (c / 10.0);
System.out.println(a + "公裡的養路費為" + d + "元");
break;
case 3:
c = 10 * 25 + 25 * 15 + 25 * 20 + (a - 75) * 20;
d = (float) (c / 10.0);
System.out.println(a + "公裡的養路費為" + d + "元");
break;
default:
System.out.println("輸入值超出取值範圍,請重新輸入");
break;
}
}
}
}
}