PL2023/TPC6/example1
2023-03-30 16:52:55 +01:00

22 lines
307 B
Text

/* factorial.p
-- 2023-03-20
-- by jcr
*/
int i;
// Função que calcula o factorial dum número n
function fact(n){
int res = 1;
while res > 1 {
res = res * n;
res = res - 1;
}
}
// Programa principal
program myFact{
for i in [1..10]{
print(i, fact(i));
}
}