NYOJ题目822画图
------------------------
AC代码:
1 import java.util.Scanner; 2 3 public class Main { 4 5 public static void main(String[] args) { 6 7 Scanner sc=new Scanner(System.in); 8 9 int n=sc.nextInt(); 10 for(int i=0;i<n;i++){ 11 System.out.println(repeate("*",n)); 12 } 13 14 } 15 16 public static String repeate(String s,int times){ 17 StringBuilder sb=new StringBuilder(s.length()*times); 18 while(times-->0) sb.append(s); 19 return sb.toString(); 20 } 21 22 }