Advertisement
alexanderik

phyramide

Oct 31st, 2013
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class piramide {
  4.     static Scanner reader= new Scanner(System.in);
  5.     public static void main(String[]args){
  6.         System.out.print("Input rows:");
  7.         int x = reader.nextInt();
  8.         for(int r=1; r<=x; r++){
  9.             for(int s=(x-r); s>0; s--){
  10.                 System.out.print(".");}
  11.                     for(int c=1; c<=(2*r-1); c++){
  12.                             System.out.print("$");}
  13.                     for(int s=(x-r); s>0; s--){
  14.                         System.out.print(".");}
  15.                     System.out.println("");
  16.     }
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement