2016=666 + 666 + 666 + 6 + 6 + 6
2016=888 + 888 + 88 + 88 + 8 + 8 + 8 + 8 + 8 + 8 + 8 + 8
2016=999 + 999 + 9 + 9
2016=168 + 168 + 168 + 168 + 168 + 168 + 168 + 168 + 168 + 168 + 168 + 168
A total of 12, 168, isn't it amazing? Write a small program verify,
#include
Int main ()
{
Int the sum, num;
Int count=0;
Int _sum;
Printf (" please enter an integer: ");
The scanf (" % d ", & amp; The sum);
_sum=sum;
While (sum!=0)
{
The sum/=10;
count++;
}
Printf (" \ n input number is % d digits \ n \ n ", count);
Printf (" input a integer values and is less than the sum of the 11 value of the length of the num: ");
The scanf (" % d ", & amp; Num);
While (_sum & gt;=0 & amp; & _sum & gt; Num)={
_sum -=num;
Printf (" num=% d, _sum=% d \ n ", num, _sum);
}
If (_sum & gt;=0) {
Num/=10;
While (_sum - num>=0) {
_sum -=num;
Printf (" num=% d, _sum=% d \ n ", num, _sum);
}
While (_sum - num<0 {
Num/=10;
While (_sum & gt; 0 {
_sum -=num;
Printf (" num=% d, _sum=% d \ n ", num, _sum);
}
}
}
return 0;
}