repo.or.cz
/
AROS.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
cleanup patch
[AROS.git]
/
compiler
/
purify
/
test7.c
blob
5b22236916e2de7d9b56d16d005f322b64ec2d5a
1
/*
2
Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3
$Id$
4
*/
5
6
#include <stdio.h>
7
#include <stdlib.h>
8
9
int
f
(
int
i
)
10
{
11
if
(
i
<=
1
)
12
return
1
;
13
else if
(
i
==
2
)
14
return
2
;
15
16
return
f
(
i
-
1
) +
f
(
i
-
2
);
17
}
18
19
int
main
(
int
argc
,
char
**
argv
)
20
{
21
int
i
;
22
23
if
(
argc
==
1
)
24
{
25
printf
(
"Usage: %s number
\n
"
,
argv
[
0
]);
26
return
5
;
27
}
28
29
i
=
atoi
(
argv
[
1
]);
30
31
printf
(
"f(%d) = %d
\n
"
,
i
,
f
(
i
));
32
33
return
0
;
34
}