package ru.job4j.loop;

/**
* Paint.
*
* @author Sergey Indyukov (onl.ont@mail.ru)
* @version $Id$
* @since 0.1
*/
public class Paint {
/** Method piramid.
* @param h  
* @return String -
*/
	public String piramid(int h) {
		for (int i = 0; i < h; i++) {
			for (int j = 1; j < h - 1; j++) {
					System.out.print(" ");
			}
			for (int k = i; k < h; k++) {
				System.out.print("^");
			}
		System.out.println();
		}
	}
}

@@ -160,17 +160,31 @@
 param h 
- 
+%D0%BF%D0%B5%D1%80%D0%B2%D1%8B%D0%B9 %D0%B0%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82
 %0A* @retu
@@ -193,17 +193,22 @@
  String 
--
+%D1%87%D1%82%D0%BE-%D1%82%D0%BE
 %0A*/%0A%09pub
@@ -235,16 +235,58 @@
 nt h) %7B%0A
+%09%09StringBuilder sB = new StringBuilder();%0A
 %09%09for (i
@@ -325,17 +325,17 @@
 int j = 
-1
+i
 ; j %3C h 
@@ -354,29 +354,88 @@
 %09%09%09%09
-%09System.out.print(%22 %22
+sB.append(' ');%0A%09%09%09%7D%0A%09%09%09for (int j = h - i; j %3C= h + i; j++) %7B%0A%09%09%09%09sB.append('%5E'
 );%0A%09
@@ -454,23 +454,27 @@
 int 
-k
+j
  = i; 
-k
+j
  %3C h
+ - 1
 ; 
-k
+j
 ++) 
@@ -483,63 +483,109 @@
 %09%09%09%09
-System.out.print(%22%5E%22);%0A%09%09%09%7D%0A%09%09System.out.println();%0A%09%09%7D
+sB.append(' ');%0A%09%09%09%09sB.append(System.getProperty(%22line.separator%22));%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return sB.toString();
 %0A%09%7D%0A

task 4412