Make an example program a bit more interesting
This commit is contained in:
parent
23cf02cc38
commit
71bbc1e65d
2 changed files with 10 additions and 5 deletions
|
@ -39,4 +39,4 @@ As a result, you'll get an `example.raw` binary. To execute it:
|
||||||
./rve ../example/example.raw
|
./rve ../example/example.raw
|
||||||
```
|
```
|
||||||
|
|
||||||
The expected output of the example program is `269`.
|
The expected output of the example program is `40320`.
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
static int mem = 56;
|
static int mem = 1;
|
||||||
|
|
||||||
|
int fact(int n) {
|
||||||
|
if (n == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return n * fact(n-1);
|
||||||
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
int a = 42;
|
mem = fact(8);
|
||||||
int b = 5;
|
|
||||||
mem = mem + a*b + 3;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue