int n = 0; while (n < 5) { int m = 0; while (m < 10) { System.out.print("Q"); m++; } System.out.println(); n++; } } }