[白俊]-ステップ解答(繰り返し)11021


白準11021号


A+B -7


質問元https://www.acmicpc.net/problem/11021

私が書いたコード
import java.io.IOException;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class Main {

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
		int n = Integer.parseInt(br.readLine()); //int형 변환
		
		for(int i=1; i<=n; i++) {
			StringTokenizer st = new StringTokenizer(br.readLine());
			bw.write("Case #"+i+": "+ (Integer.parseInt(st.nextToken()) + Integer.parseInt(st.nextToken())) +"\n");
		}
		bw.flush();
		bw.close();
	}
}
BufferedReader/stringTokenizer/BufferedWriterの説明を参照してください