3 条题解

  • 1
    @ 2023-12-13 22:05:02

    《java辅导》:学打表,练习打表,....

    import java.util.Scanner;
    
    public class Main {
        public static void main(String[] args) {
            String[][] str =
                    {{" _ ","| |","|_|"},
                    {"   ","  |","  |"},
                    {" _ "," _|","|_ "},
                    {" _ "," _|"," _|"},
                    {"   ","|_|","  |"},
                    {" _ ","|_ "," _|"},
                    {" _ ","|_ ","|_|"},
                    {" _ ","  |","  |"},
                    {" _ ","|_|","|_|"},
                    {" _ ","|_|"," _|"}};
            Scanner sc = new Scanner(System.in);
            while(sc.hasNext()){
                String s = sc.nextLine();
                char[] chs = s.toCharArray();
                for (int i = 0; i < 3; i++) {
                    for (char ch: chs){
                        if(ch >= '0' && ch<= '9') {
                            System.out.print(str[ch - '0'][i]);
                        }
                    }
                    System.out.println();
                }
                System.out.println();
            }
        }
    }
    

    信息

    ID
    3
    时间
    1000ms
    内存
    32MiB
    难度
    9
    标签
    (无)
    递交数
    27
    已通过
    4
    上传者