코딩테스트연습/프로그래머스
프로그래머스(0) - 문자열 반복해서 출력하기
YJDawn
2023. 8. 11. 17:01
- 문자열 반복해서 출력하기
간단하다.
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
int n = sc.nextInt();
String result="";
for ( int i=0; i<n ; i++ ) {
result+=str;
}
System.out.println(result);
}
}