Notizen
Prog Estruturada
Inhalt der Notizen (1)
Seite 1
Problemas URI judge - recursão
1024
1253
1161
1033
1399
#include <stdio.h>
double getfat(int k){
double val;
if (k<=1)
return (1);
else
val=k*(getfat(k-1));
return val;
}
int main()
{
int m, n, res;
printf("Insira dois valores: \n");
scanf("%d%d",&n, &m);
if(m == "eof"){
exit(0);
}
res = getfat(m)+getfat(n);
printf("A soma dos fatoriais é: %d \n ", res);
main();
return 0;
}
Informationen
- Beschreibung
- Notiz am Prog Estruturada, erstellt von Mário Gilson de Oliveira Nunes am 11/10/2019.
- Erstellt von
- Mário Gilson de Oliveira Nunes · Okt 2019
- Aktualisiert
- 11 Okt 2019
- Aufrufe
- 0
- Bewertung