내 답안
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();
for(int i=0; i<n; i++){
System.out.print(str);
}
}
}
Java
복사
다른 사람 풀이법
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();
System.out.println(str.repeat(n));
}
}
Java
복사