백준2558번1 [백준 2558번 - java] A+B - 2 https://www.acmicpc.net/problem/2558 내 답안 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int A = s.nextInt(); int B = s.nextInt(); System.out.println(A+B); } } 1000번 문제(https://www.acmicpc.net/problem/1000)와는 다른 점 - 1000번 문제는 두 수를 한 줄에 입력받음 - 2558번 문제는 한 줄에 하나의 수를 입력받음 그러나 Scanner 클래스의 nextInt() 메서드는 공백(space)이나 개행(enter.. 2021. 11. 2. 이전 1 다음