-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc001.c
More file actions
49 lines (42 loc) · 897 Bytes
/
c001.c
File metadata and controls
49 lines (42 loc) · 897 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
39
40
41
42
43
44
45
46
47
48
49
#include <stdio.h>
int main(){
int i, j = 0;
// V자 모양 찍기
for(j=0; j<5; j++){
for(i=0; i<10; i++){
// j => 0, i=0 9
// j => 1, i=1,8
// j => 2, i=2,7
if(i == j || i == 9 - j){
printf("*");
}
else {
printf(" ");
}
if(i==9){
printf("\n");
}
}
}
for(i=0; i<6; i++){
for(j=0; j<10; j++){
printf("*");
}
printf("\n");
}
for(i = 0; i < 4; i++) {
for(j = 0; j < 10; j++) {
if ( j <= i || j >= 9 - i) {
printf(" ");
}
else {
printf("*");
}
}
printf("\n");
}
for(i=0; i<10; i++){
printf("*");
}
return 0;
}