导包:
1:手动导包:import java.util.Scanner;
2:自动导包
3:快捷键
import java.util.Scanner;
//减肥计划switch版
public class MethodTest{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println(“请输入一个星期数”);
int week = sc.nextInt();
//使用switch语句实现
switch(week){
case 1:
case 2:
System.out.println("跑步");
break;
default:
System.out.println("你输入的月份有误");
break;
}
}
}
//案例:逢七过
public class MethodTest {
public static void main(String[] args) {
for (int x = 1; x < 100; x++) {
if (x % 10 == 7 || x / 10 % 10 == 7|| x %7 == 0) {
System.out.println(x);
}
}
}
}
*/