输入星期数,显示今天的减肥活动
周一:跑步
周二:游泳
周三:慢走
周四:动感单车
周五:拳击
周六:爬山
周日:好好吃一顿
代码实现:
import java.util.Scanner;
public class e {public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int c=sc.nextInt()-1;
String b;
String[]a={"pao","you","zou","che","quan","pa","chi"};
if (c<0||c>6){
b="youwu";
}else{
b=a[c];
}
System.out.println(b);
}
|
|