不科学
package aini;
import java.util.Scanner;
public class haoma {
@SuppressWarnings("resource")
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner ww=new Scanner(System.in);
System.out.println("路程:");
int s=(int)ww.nextInt();
if(s>=250)
{
s/=50;
switch(s){
case 5: System.out.println("优惠2%");
break;
case 10: System.out.println("优惠5%");
break;
case 20: System.out.println("优惠8%");
break;
case 40: System.out.println("优惠10%");
break;
case 60: System.out.println("优惠15%");
break;
default:
System.out.println("无优惠");
}
}
else
System.out.println("无优惠");
}
}
为什么除了250,500等这些都是无优惠?