public class aaa {
public static void main(String[] args){
int totalcost=500;
if (totalcost>=200&&totalcost<300) {
System.out.println("可获得优惠泉"); }
else {
}
if (totalcost>300&&totalcost<500);{
System.out.println("可获得五十远");
}
else{ ........................................................这里则么会报错
}
if (totalcost>500) {
System.out.println("100yuan");}
else {
System.out.println("你的消费金额不足"); }
}
if (totalcost>300&&totalcost<500);{ 这里多了一个分号。作者: xuminghaoxu 时间: 2010-5-19 19:08
谢谢诸位回复作者: icangfeng 时间: 2010-5-20 20:30
哎,代码写的太不规范了,呵呵
public class aaa {
public static void main(String[] args){
int totalcost=500;
if (totalcost>=200&&totalcost<300)
{
System.out.println("可获得优惠卷");
}
else
{
}
if (totalcost>300&&totalcost<500)
{
System.out.println("可获得五十远");
}
else
{ ........................................................这里则么会报错
}