줄의 개수를 세는 프로그램을 만듭시다
eof 같으니
eof 식으로 하겠습니다
코드입니다
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s;
int count = 0;
while ((s=br.readLine()) != null){
count += 1;
}
System.out.print(count);
}
}
'백준 문제풀기 > JAVA' 카테고리의 다른 글
[백준 10989 JAVA 자바] 수 정렬하기 3 (0) | 2023.08.20 |
---|---|
[백준 10988 JAVA 자바] 팰린드롬인지 확인하기 (0) | 2023.08.20 |
[백준 10953 JAVA 자바] A+B - 6 (0) | 2023.08.19 |
[백준 10952 JAVA 자바] A+B - 5 (1) | 2023.08.19 |
[백준 10950 JAVA 자바] A+B - 3 (3) | 2023.08.19 |