题解 | 明天星期几?

明天星期几?

https://www.nowcoder.com/practice/9db9e3d19cde405ba94db09ed1c5f3f3

import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int d = sc.nextInt();
        switch(d){
            case 1:
                System.out.println("2");
                break;
            case 2:
                System.out.println("3");
                break;
            case 3:
                System.out.println("4");
                break;
            case 4:
                System.out.println("5");
                break;
            case 5:
                System.out.println("6");
                break;
            case 6:
                System.out.println("7");
                break;
            case 7:
                System.out.println("1");
                break;
            }
        }
    }

全部评论

相关推荐

caicaidog:现实里没实习的还是占多数的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务