设计停车系统
有一说一这个题有点脑瘫
private static int big;
private static int medium;
private static int small;
public T26(int big, int medium, int small) {
this.big = big;
this.medium = medium;
this.small = small;
}
//进车
public boolean addCar(int carType) {
if (carType == 1){
if (big > 0){
big --;
return true;
}
}else if (carType == 2){
if (medium > 0){
medium --;
return true;
}
}else if (carType == 3){
if (small > 0){
small --;
return true;
}
}
return false;
}