Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- String star = "*";
- String cross = "+";
- System.out.println();
- System.out.println();
- // CHOINKA PODSTAWOWA
- // glowna czesc choinki
- for (int i = 0; i < 10; i++) {
- for (int j = 0; j < 20; j++) {
- if (j <= 10 + i && j >= 10 - i) {
- System.out.print(star);
- } else {
- System.out.print(" ");
- }
- }
- System.out.println();
- }
- // pień choinki
- for (int i = 0; i < 4; i++) {
- for (int j = 0; j < 19; j++) {
- if (j >= 8 && j <= 12) {
- System.out.print(star);
- } else {
- System.out.print(" ");
- }
- }
- System.out.println();
- }
- System.out.println();
- System.out.println();
- // ----------------------------------------------------------------->
- // CHOINKA ROZSZERZONA
- // glowna czesc choinki
- for (int i = 0; i < 8; i++) {
- for (int j = 0; j < 19; j++) {
- if (j >= 10 - i && j <= 10 + i) {
- if (j < 10 + i && j > 10 - i) {
- System.out.print(cross);
- } else {
- System.out.print(star);
- }
- } else {
- System.out.print(" ");
- }
- }
- System.out.println();
- }
- // podstawa choinki
- for (int y = 0; y < 19; y++) {
- if (y > 1) {
- System.out.print(star);
- } else {
- System.out.print(" ");
- }
- }
- // pień
- System.out.println();
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 19; j++) {
- if (j >= 8 && j <= 12) {
- System.out.print(star);
- } else {
- System.out.print(" ");
- }
- }
- System.out.println();
- }
- //----------------------------------------------------->
- // pusta choinka
- System.out.println();
- System.out.println();
- // glowna czesc choinki
- for (int i = 0; i < 8; i++) {
- for (int j = 0; j < 19; j++) {
- if (j >= 10 - i && j <= 10 + i) {
- if (j < 10 + i && j > 10 - i) {
- System.out.print(" ");
- } else {
- System.out.print(star);
- }
- } else {
- System.out.print(" ");
- }
- }
- System.out.println();
- }
- // podstawa choinki
- for (int y = 0; y < 19; y++) {
- if (y > 1) {
- System.out.print(star);
- } else {
- System.out.print(" ");
- }
- }
- // pień
- System.out.println();
- for (int i = 0; i < 3; i++) {
- for (int j = 0; j < 19; j++) {
- if (j >= 8 && j <= 12) {
- System.out.print(star);
- } else {
- System.out.print(" ");
- }
- }
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement