repo.or.cz
/
eleutheria.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Dummy commit to test new ssh key
[eleutheria.git]
/
homework
/
tree.c
blob
47cb7ab7a0d7c03a34eeb1d856bc486a9db0aabf
1
/*
2
* Compile with:
3
* gcc tree.c -o tree -Wall -W -Wextra -ansi -pedantic
4
*/
5
6
#include <stdio.h>
7
#include <stdlib.h>
8
9
#define LINES 10
10
#define COLS (2 * LINES)
11
12
int
main
(
void
)
13
{
14
unsigned int
i
,
j
;
15
16
for
(
i
=
0
;
i
<
LINES
;
i
++) {
17
for
(
j
=
0
;
j
<
COLS
;
j
++) {
18
if
((
j
< (
COLS
/
2
-
i
)) || (
j
> (
COLS
/
2
+
i
)))
19
printf
(
" "
);
20
else
21
printf
(
"*"
);
22
}
23
printf
(
"
\n
"
);
24
}
25
26
return
EXIT_SUCCESS
;
27
}