java基础-简单小demo

package demo01;

import java.util.Scanner;

/**
 * @outhor liu
 * @dare 2019/12/23 15:28
 */
public class T6 {
    public static void main(String[] args) {
        System.out.println("-----家庭收支记账软件-----");
        System.out.println("1 收支明细");
        System.out.println("2 登记收入");
        System.out.println("3 登记支出");
        System.out.println("4 退出");
        System.out.println("请选择(1-4)");
        Scanner scanner = new Scanner(System.in);
        System.out.println("请选择");
        int num=scanner.nextInt();
        switch (num){
            case 1:
                System.out.println("请输入收入金额");
                int a=scanner.nextInt();
                System.out.println("请输入收入说明");
                String tb=scanner.next();
                System.out.println("当前收支明细");
                System.out.println("收支金额   说明");
                System.out.println(a+tb);

        }
    }
}

你可能感兴趣的:(java基础-简单小demo)