|
// Java多分支判断星期
|
|
package xiangmu;
|
|
|
|
public class Ceshi {
|
|
public static void main(String args[]) {
|
|
int xingqi = 3;
|
|
if(xingqi == 1) {
|
|
dayin("星期一");
|
|
}else if(xingqi == 2) {
|
|
dayin("星期二");
|
|
}else if(xingqi == 3) {
|
|
dayin("星期三");
|
|
}else if(xingqi == 4) {
|
|
dayin("星期四");
|
|
}else if(xingqi == 5) {
|
|
dayin("星期五");
|
|
}else {
|
|
dayin("周末");
|
|
}
|
|
}
|
|
public static void dayin(String zifuchuan) {
|
|
System.out.println(zifuchuan);
|
|
}
|
|
}
|