import java.util.*;
public class Hello{
public static void main(String[] args){
System.out.println("輸入1則輸出我是冠軍。輸入2則什麼都不輸出");
Scanner inputScanner = new Scanner(System.in);\\試用新類Scanner,該類的構造函數可以(接收)用戶的輸入數據
int num = inputScanner.nextInt(); \\試用Scanner類實例的 nextInt()方法(獲取)用戶輸入的數據。
if(num == 1){
System.out.println("冠軍非你莫屬");
}
}
}
儘管copy去測試demo去吧。這個核心知識點在util包裏的Scanner類的用法及實現。我是純打的,如果運行不通。請留言,咱們一同學習進步Persist in the end and
never give up