Link to the exercise in question
Example entry
1000
2000
500
Sample output
40 25
50 40
25 20
The code works correctly, but when it comes to telling you that the puzzle has 64 pieces, it takes me out 9 8, should not I get 8 8?
#include <stdio.h>
main()
{
int n, i, altura;
printf("Introduce numero de piezas: ");
scanf("%d", &n);
i=1;
do
{
altura=n/i;
i++;
}while(n%altura!=0 || i<=altura);
printf("%d %d", i, altura);
}