- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA8P9.java
More file actions
Latest commit
38 lines (37 loc) · 470 Bytes
/
Copy pathA8P9.java
File metadata and controls
38 lines (37 loc) · 470 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
classA8P9
{
publicstaticvoidmain(String[] args)
{
intn = 5;
intk = 1;
charc = 'a';
for (inti=0;i<n ;i++ )
{
intm = k;
charc1 = c;
for (intj=0;j<n ;j++ )
{
if (i>=j)
{
if (i%2==0)
{
System.out.print(m++);
}
else
{
System.out.print(c1++);
}
}
}
System.out.println();
if (i%2==0)
{
k++;
}
else
{
c++;
}
}
}
}