Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Figure {
- public static void main(String[] args) {
- int i = 0;
- System.out.print("Максимальная высота: ");
- Scanner s = new Scanner(System.in);
- int apex = s.nextInt();
- do {
- for(int i1 = 0; i1 <= i; i1++)
- System.out.print("*");
- System.out.println();
- i++;
- } while (i != apex-1);
- do {
- for(int i1 = 0; i1 <= i; i1++)
- System.out.print("*");
- System.out.println();
- i--;
- } while(i != -1);
- }
- }
Add Comment
Please, Sign In to add comment