forked from deepdalsania/tutorials
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPaintW.java
More file actions
38 lines (33 loc) · 705 Bytes
/
PaintW.java
File metadata and controls
38 lines (33 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package extraknowledge;
public class PaintW {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("W");
int n = 4;
int i,j; //see draw M like that create one table 5*5 and draw w and put that condition on if else
for (i = 1; i < 5; i++) {
for ( j = 1; j <= i; j++) {
addspace();
}
System.out.println("W");
}
for (i = 1; i < 3 ; i++) {
for (j = 1; j >= n+i ; j--) {
addspace();
}
System.out.println("W");
}
/*for(i = 5; i > 1 ; i--){
for(j = 1; j <=n+i; j++){
addspace();
}
System.out.print("W");
}*/
}
public static void addspace(){
System.out.print(" ");
}
}