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!!


沒有留言:

張貼留言

作業2 MQTT (Relay + DHT22) 控制 ------- 利用Node-Red

作業2 MQTT (Relay + DHT22) 控制 ------- 利用Node-Red 1) 安裝Node-Red  https://ithelp.ithome.com.tw/articles/10201795 https://www.youtube.com/watch?v...