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;
}
}
}
}
}