Notice
Recent Posts
Recent Comments
Link
Everything has an expiration date
BAEKJOON - 11382 : 꼬마 정민 본문
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
// 1. 변수 선언
Scanner sc = new Scanner(System.in);
long a, b, c;
// 2. 사용자로부터 세 개의 정수 입력받기
a = sc.nextLong();
b = sc.nextLong();
c = sc.nextLong();
// [RunTime ERROR]===============================
// ★ nextInt() 로 받으면 안 된다!
// ★ nextLong() 으로 입력 받아야만 문제에서 주어진
// 정수의 범위 합을 구할 수 있다!
//===============================================
// 3. 세 개의 수 더해서 출력.
System.out.println(a + b + c);
}
}
'BAEKJOON - challenge > 입출력과 사칙연산' 카테고리의 다른 글
BAEKJOON - 10172 : 개 (0) | 2023.09.17 |
---|---|
BAEKJOON - 2588 : 곱셈 (0) | 2023.09.17 |
BAEKJOON - 10430 : 나머지 (0) | 2023.09.17 |
BAEKJOON - 18108 : 1998년생인 내가 태국에서는 2541년생?! (0) | 2023.09.17 |
BAEKJOON - 10926 : ??! (0) | 2023.09.17 |