-
[java]백준 그대로 출력하기 11718번알고리즘 문제풀이/백준(자바) 2023. 3. 18. 17:54
코드
import java.util.Scanner; public class BOJ_11718 { public static void main(String[] args) { Scanner in = new Scanner(System.in); for(int i=0; i<100; i++){//입력 최대 100 if (!in.hasNext()) { break; } String q = in.nextLine(); System.out.println(q); } in.close(); } } // hasNext() 읽어올 요소가 남아있는지 여부 요소 있다 True 없다면 false // if문에서 없다면 부정하고 True이면 break
링크
https://www.acmicpc.net/problem/11718
'알고리즘 문제풀이 > 백준(자바)' 카테고리의 다른 글
[java]백준 사칙연산 10869번 (0) 2023.03.20 [java]백준 ??! 10926번 (0) 2023.03.19 [java]백준 합 8393번 (0) 2023.03.17 [java]백준 구구단 2739번 (0) 2023.03.17 [java]백준 A+B - 3 10950번 (0) 2023.03.17