809*??=800*??+9*??+1 其中??代表的两位数,8*??的结果为两位数,9*??的结果为3位数。求??代表的两位数,及809*??后的结果。
#include <stdio.h>
int output(int number1, int number2, int number3)
{
printf("809*%ld = 800*%ld + 9*%ld + 1\n",number1, number2, number3);
//printf("809*%ld=%ld\n",number1, 809*number1);
return 0;
}
int main()
{
/*809*??=800*??+9*??+1,??为两位数,8*??为两位数,9*??为三位数,求??的值及809*??的值*/
int number1, number2, number3;
for (number1=10; number1<100; ++number1)
{
for (number2=10; number2<100; ++number2)
{
for (number3=100; number3<1000; ++number3)
{
if (809*number1 == 800*number2 + 9*number3 + 1)
output(number1, number2, number3);
}
}
}
return 0;
}