java牛客網 輸入輸出

作者:管理員
鏈接:https://www.nowcoder.com/discuss/276
來源:牛客網

import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {//注意while處理多個case              int a = in.nextInt();
      int b = in.nextInt();
            System.out.println(a + b);
        }
    }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章