Posted by Federico De Malmayne Dup on Sun 28 Jun 23:32
report abuse | View followups from Anonymous | download | new post
- #include <stdio.h>
- int movete( int numDiscos, int astaOrigen, int astaDestino, int astaTemporal);
- int main()
- {
- int numDiscos;
- int astaOrigen;
- int astaDestino;
- int astaTemporal;
- scanf("%d", &numDiscos);
- scanf("%d", &astaOrigen);
- scanf("%d", &astaDestino);
- scanf("%d", &astaTemporal);
- movete( numDiscos, astaOrigen, astaDestino, astaTemporal);
- return 0;
- }
- int movete( int cantidad, int origen, int destino, int temporal)
- {
- if (cantidad == 1)
- else
- {
- movete( cantidad -1, origen, temporal, destino);
- movete( 1, origen, destino, temporal);
- movete( cantidad -1, temporal, destino, origen);
- }
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.