fork download
  1. import java.util.Scanner;
  2.  
  3. public class Main{
  4. public static void main(String[] args){
  5. Scanner sc = new Scanner(System.in);
  6. int rt = sc.nextInt();
  7. while(rt>0){
  8. int rn = sc.nextInt();
  9.  
  10. for (int i = 1; i <= rn; i++) {
  11. for (int j = 1; j <= rn; j++) {
  12. System.out.print("##");
  13. }
  14. for (int j = 1; j <= rn; j++) {
  15. System.out.print("..");
  16. }
  17. System.out.println();
  18. }
  19.  
  20. rt--;
  21. }
  22. }
  23. }
Success #stdin #stdout 0.15s 54548KB
stdin
4
1
2
3
4
stdout
##..
####....
####....
######......
######......
######......
########........
########........
########........
########........