mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-06-25 10:56:27 -06:00
more examples
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
int fact (int n) {
|
||||
int f ;
|
||||
f = 1 ;
|
||||
while (1 < n) {
|
||||
f = n * f ;
|
||||
n = n - 1 ;
|
||||
}
|
||||
return f ;
|
||||
} ;
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 132 KiB |
@@ -0,0 +1,21 @@
|
||||
int fact (int n) {
|
||||
int f ;
|
||||
f = 1 ;
|
||||
{
|
||||
while (1 < n) {
|
||||
f = n * f ;
|
||||
n = n - 1 ;
|
||||
}
|
||||
}
|
||||
return f ;
|
||||
} ;
|
||||
|
||||
int main () {
|
||||
int n ;
|
||||
n = 1 ;
|
||||
{
|
||||
while (n < 11) printf(int,fact(n)) ; n = n+1 ;
|
||||
}
|
||||
return ;
|
||||
} ;
|
||||
|
||||
Reference in New Issue
Block a user