2019年4月3日 星期三

[JAVA] System.in 輸入

[JAVA] System.in 輸入

import java.util.Scanner;

public class HelloUser {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Please input a number: ");
        System.out.printf("Oh! I get %d!!", scanner.nextInt());
    }
}

stdin
10099

輸出畫面
Please input a number: Oh! I get 10099!!


沒有留言:

張貼留言

WOKWI ESP32 LED Control , Node-Red MQTT SQLITE  

WOKWI ESP32 LED Control ,  Node-Red  MQTT SQLITE   const char broker[] = "test.mosquitto.org" ; //const char broker[] = "br...