mise à jour des tests

This commit is contained in:
Dimitri Lajou
2025-03-27 14:18:02 +01:00
parent 89abf8f85a
commit eef8242f11
142 changed files with 165 additions and 36 deletions

View File

@@ -0,0 +1,30 @@
PROTO INT fact(k)
FUNC VOID affichetab(taille, t[]) {
INT i
i := 0
WHILE taille - i
DO {
PRINT "f(", i, ") = ", t[i], "\n"
i := i+1
}
DONE
}
FUNC VOID main() {
INT n
PRINT "Que vaut n ?"
READ n
{
INT i, t[n]
i := 0
WHILE n - i
DO {
t[i] := fact(i)
i := i+1
}
DONE
affichetab(n, t)
}
}
FUNC INT fact(n)
IF n THEN RETURN n* fact(n-1)
ELSE RETURN 1 FI