-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQuestion from 28th April 10:37 a.m.
49 lines (41 loc) · 1.11 KB
/
Question from 28th April 10:37 a.m.
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
39
40
41
42
43
44
45
46
47
48
49
// #include<stdio.h>
// int main(){
// printf("ssup");
// return 0;
// }
#include<stdio.h>
int main(){
int i,j,k,J,jnot;
i=11;
J=2*i-1;
jnot=J-2;
for(i=0;i<11;i++){
for(j=1;j<=J;j++){
if(j==1||j==J){
printf("*");
}
else{
if(i<=(i+1)/2){
for(k=1;k<i;k++){
printf("%d",k);
}
for(k=i;k<J;k--){
printf("%d",k-1);
}
}
else{
for(k=1;k<i;k++){
printf("%d",k);
}
for(k=i;k<jnot;k--){
printf("%d",k);
}
}
}
}
}
}
jnot=jnot-2;
printf("\n");
}
}