Los problemas matemáticos se resuelven mediante programación.
¿Usando pascal
var? x, y: entero largo;
¿Función? s(p, q: longint): longint;
Iniciar
¿Si? (p lt preguntó)? ¿aún? (q lt=0)? Entonces
s:=0
¿Qué más? ¿si? (p=q)? ¿aún? (q=1)? Entonces
s:=1
¿Y si? ¿si? (pgt preguntó)? Entonces qué. (Preguntar a gt1)? Entonces
s:=s(p-1, q-1) q*s(p-1, q);
Salir;
Fin;
Inicio
readln(x, y);
writeln(s(x, y));
Fin.
Si no puedes entender PASCAL, el siguiente es el código C que escribí.
Principalmente recursividad, anidamiento de funciones y estructuras de selección.
Escucha, llevo mucho tiempo codificando. Espero que puedas adoptarme. Gracias.
Espero que también te sea de ayuda.