mirror of
https://github.com/Mercantec-GHC/h4-projekt-gruppe-0-sm.git
synced 2025-04-27 16:24:07 +02:00
34 lines
505 B
Plaintext
34 lines
505 B
Plaintext
|
|
#[c_function("println")]
|
|
fn println(value: *str) -> int {}
|
|
#[c_function("print_int")]
|
|
fn print_int(value: int) -> int {}
|
|
|
|
fn factorial(v: int) -> int {
|
|
if v == 0 {
|
|
return 1;
|
|
}
|
|
return v * factorial(v - 1);
|
|
}
|
|
|
|
#[c_export("sbc_main")]
|
|
fn main() -> int {
|
|
let i = 0;
|
|
|
|
// while i < 10 {
|
|
//
|
|
// println("Hello\ world");
|
|
//
|
|
// i = i + 1;
|
|
// }
|
|
|
|
let a = factorial(5);
|
|
|
|
print_int(a);
|
|
|
|
return 0;
|
|
}
|
|
|
|
// vim: syntax=slige commentstring=//\ %s
|
|
|