"BOJ 15552 빠른 A+B"의 두 판 사이의 차이

37번째 줄: 37번째 줄:
}
}
ob_flush();
ob_flush();
</source>
==Python==
<source lang='python'>
import sys
n = int(input())
result = ''
for i in range(n):
    a, b = map(int,sys.stdin.readline().split())
    print( a+b )
</source>
</source>


==참고==
==참고==
* https://www.acmicpc.net/board/view/22716
* https://www.acmicpc.net/board/view/22716

2018년 7월 27일 (금) 01:38 판

1 개요

BOJ 15552 빠른 A+B

[[분류:BOJ {{{단계}}}단계]]


2 Java

import java.util.*;
import java.io.*;
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());

        String line;
        int a, b;
        for(int i=0; i<n; i++) {
            line = br.readLine();
            String[] nums = line.split(" ");
            a = Integer.parseInt(nums[0]);
            b = Integer.parseInt(nums[1]);
            bw.write( String.valueOf(a+b) + "\n" );
        }
        bw.flush();
    }
}

3 PHP

<?php
fscanf(STDIN,"%d",$N);
ob_start();
for( $i=0; $i<$N; $i++ ) {
    fscanf(STDIN,"%d %d",$a,$b);
    echo ($a+$b) . "\n";
}
ob_flush();

4 Python

import sys
n = int(input())
result = ''
for i in range(n):
    a, b = map(int,sys.stdin.readline().split())
    print( a+b )

5 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}