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


沒有留言:

張貼留言

2026 作業1 MQTT基本觀念

 2026 作業1MQTT基本觀念 作業  參考下面網址 https://alex9ufoexploer.blogspot.com/2025/02/1-mqtt-relay-dht22-mqtt-box-pc-mymqtt.html https://alex9ufoexploer...