백준 #26560번 Periods

jhj·2024년 2월 16일

백준 JAVA

목록 보기
332/583
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		sc.nextLine();
		for(int i = 0; i < n; i++) {
			String a = sc.nextLine();
			
			if(a.charAt(a.length() - 1) == '.') {
				System.out.println(a);
			}else {
				System.out.println(a + ".");
			}
		}
		sc.close();
	}
}

버퍼 비우기 - sc.nextLine();

profile
개발자를 꿈꾸는

0개의 댓글