纪念自己用java写的第一个题目

xiaoxiao2021-02-27  223

A + B Problem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 675978    Accepted Submission(s): 210518 Problem Description Calculate A + B.   Input Each line will contain two integers A and B. Process to end of file.   Output For each case, output A + B in one line.   Sample Input 1 1   Sample Output 2   哈哈哈哈哈哈哈哈哈哈

import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while(in.hasNextInt()){ int a=in.nextInt(); int b=in.nextInt(); System.out.println(a+b); } in.close(); } }

转载请注明原文地址: https://www.6miu.com/read-11254.html

最新回复(0)