fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import static java.lang.Math.*;
  7.  
  8. class Ideone
  9. {
  10. public static void main (String[] args){
  11. Scanner sc = new Scanner(System.in);
  12. int m,n,k;
  13. m = sc.nextInt();
  14. n = sc.nextInt();
  15. k = sc.nextInt();
  16. for (int i = 0; i < m; i++){
  17. for (int j = 0; j < n; j++){
  18. if (i%6 == 0)
  19. System.out.print("+");
  20. else if (j%(k+1) == 0)
  21. System.out.print("+");
  22. else
  23. System.out.print(".");
  24. }
  25. System.out.println(" ");
  26. }
  27. }
  28. }
Success #stdin #stdout 0.06s 711680KB
stdin
13
31
9
stdout
+++++++++++++++++++++++++++++++ 
+.........+.........+.........+ 
+.........+.........+.........+ 
+.........+.........+.........+ 
+.........+.........+.........+ 
+.........+.........+.........+ 
+++++++++++++++++++++++++++++++ 
+.........+.........+.........+ 
+.........+.........+.........+ 
+.........+.........+.........+ 
+.........+.........+.........+ 
+.........+.........+.........+ 
+++++++++++++++++++++++++++++++