View

1001

System.out.print("Hello");

1002

System.out.print("Hello World");

1003

System.out.printf("Hello%nWorld");

1004

System.out.printf("\'Hello\'");

1005

System.out.printf("\"Hello World\"");

1006

System.out.printf("\"!@#$%%^&*()\"");

1007

System.out.printf("\"C:\\Download\\hello.cpp\"");

1008

        System.out.printf("\u250C\u252C\u2510");
        System.out.println();
        System.out.printf("\u251C\u253C\u2524");
        System.out.println();
        System.out.printf("\u2514\u2534\u2518");

1010

        Scanner Input = new Scanner(System.in);
        int Data = Integer.parseInt(Input.nextLine());
        System.out.printf("%d",Data);

1011

        Scanner Input = new Scanner(System.in);
        char x = Input.nextLine().charAt(0);
        System.out.printf("%c",x);

1012

        Scanner Input = new Scanner(System.in);
        float x = Input.nextFloat();
        System.out.printf("%f",x);

1013

        Scanner Input = new Scanner(System.in);
        int a,b;
        a = Input.nextInt();
        b = Input.nextInt();
        System.out.printf("%d %d",a,b);

1014

        Scanner Input = new Scanner(System.in);
        char x,y;
        String str;
        str = Input.nextLine();
        x = str.charAt(0);
        y = str.charAt(2);
        System.out.printf("%c %c",y,x);

1015

        Scanner Input = new Scanner(System.in);
        float x = Input.nextFloat();
        System.out.printf("%.2f",x);

1016

        Scanner Input = new Scanner(System.in);
        int x = Input.nextInt();
        System.out.printf("%d %d %d", x, x, x);

1018

        Scanner Input = new Scanner(System.in);
        int x,y;
        String str = Input.nextLine();
        String[] time = str.split(":");
        x = Integer.parseInt(time[0]);
        y = Integer.parseInt(time[1]);
        System.out.printf("%d:%d",x,y);

1019

        Scanner Input = new Scanner(System.in);
        int year,month,day;
        String str = Input.nextLine();
        String[] time = str.split("\\.");
        year = Integer.parseInt(time[0]);
        month = Integer.parseInt(time[1]);
        day = Integer.parseInt(time[2]);
        System.out.printf("%d.%02d.%02d",year,month,day);

1020

        Scanner Input = new Scanner(System.in);
        String str = Input.nextLine(); 
        String Id = str.replace("-", "");     
        System.out.print(Id);
Share Link
reply
«   2024/12   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31