Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Kita3 {
- public static void main(String[] args) {
- /*
- ##*#####*#####* 2 1 5 1 5 1
- #***###***###*** 1 3 3 3 3 3
- *****#*****#***** 0 5 1 5 1 5
- = = =
- = = = 2 1 5 1 5 1 - 3 times
- = = =
- */
- int base=5;
- int totalTree=3;
- for (int row=1;row<=base;row+=2){
- //for
- for (int prefix=(base-row)/2;prefix>0;prefix-=1){
- System.out.print(" ");
- }
- for (int printTree=0;printTree<totalTree;printTree+=1) {
- //tree
- for (int tree = 0; tree < row; tree += 1) {
- System.out.print("*");
- }
- //space
- for (int space = 0; space < base - row + 1; space += 1) {
- System.out.print(" ");
- }
- }
- System.out.println();
- }
- //print the stamp
- for (int counter=0;counter<3;counter+=1){
- System.out.printf("%2c%c%c%5c%c%5c",' ','=',' ','=',' ','=');
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement