[BoJ] 11721 with JAVA

msriver·2020년 6월 1일
0

알고리즘/자료구조

목록 보기
8/20
post-custom-banner
import java.io.*;

public class Main{
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        
        String str=br.readLine();
        int n = str.length();
        int i=0;
        
        while(n!=0) {
        	if(n<10) {
        		bw.write(str.substring(i, i+n)+"\n");
        		break;
        	}
        	bw.write(str.substring(i, 10+i)+"\n");
        	n-=10;
        	i+=10;
        }
        
        br.close();
        bw.flush();
        bw.close();
    }
}
profile
NOBODY
post-custom-banner

0개의 댓글