File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,54 @@ public class Main
102102 }
103103 System.out.println();
104104 }
105+ /* 1
106+ 0 1
107+ 1 0 1
108+ 0 1 0 1 */
109+ for(int i=1;i<=n;i++){
110+ for(int j=1;j<=i;j++){
111+ if((i+j)%2==0){
112+ System.out.print(1+" ");
113+ }
114+ else{
115+ System.out.print(0 +" ");
116+ }
117+ }
118+ System.out.println();
119+ }
120+
121+ /* 1
122+ 1 2
123+ 1 2 3
124+ 1 2 3 4 */
125+ for(int i=1;i<=n;i++){
126+ for(int j=1;j<=n;j++){
127+ if(j<=n-i){
128+ System.out.print(" ");
129+ }
130+ }
131+
132+ for(int j=1;j<=i;j++){
133+ System.out.print(j+" ");
134+ }
135+ System.out.println();
136+ }
105137
138+ /* ****
139+ ****
140+ ****
141+ **** */
142+ for(int i=1;i<=n;i++){
143+ for(int j=1;j<=n;j++){
144+ if(j<=n-i){
145+ System.out.print(" ");
146+ }
147+ }
148+
149+ for(int j=1;j<=n;j++){
150+ System.out.print("*");
151+ }
152+ System.out.println();
153+ }
106154 }
107155}
You can’t perform that action at this time.
0 commit comments