Valeri12580

Risunka

Feb 1st, 2019
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class ReferatorVolumeOfPyramid {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int n = Integer.parseInt(scanner.nextLine());
  7.  
  8. System.out.print("+");
  9. for (int i = 0; i < n - 2; i++) {
  10. System.out.print(" -");
  11. }
  12. System.out.println(" +");
  13. for (int rows = 0; rows < n - 2; rows++) {
  14. System.out.print("|");
  15. for (int a = 0; a < n - 2; a++){
  16. System.out.print(" -");
  17. }
  18. System.out.println(" |");
  19. }
  20. System.out.print("+");
  21. for (int i = 0; i < n - 2; i++) {
  22. System.out.print(" -");
  23. }
  24. System.out.println(" +");
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment