/* Mantissa forward: Ask for a natural number n, the single digit is 6, 6 refers to the first number of n is four times times as: 1236----->6123? = 4*1236-----> If yes, find it! Problem-solving idea: Divide the natural number into two parts p=123 (that is, 6), the value after q=6 shift: 6*pow (the number of bits of 10,p) + p i.e.: 6*pow (number of bits of 10,p) + p = 4*nq = N%10;p = N/10;p () */#include &L T;stdio.h> #define Lenth 1000000//range of on-line void fun (int n) {if (n%10 = = 6)//First make sure everyone is 6{int p = N/10;//6 front of the value int q = 6;while (p) {Q *= 10;//6 Front There are several, 6 multiplied by 10 of several square p/= 10; if (q+ (N/10) = = 4*n)//q+p = = 4*n because P has become 0{printf ("%d\n", N) after executing the while loop;}} int main () {for (int. i=0;i<=lenth;++i) {fun (i);} return 0;}
The mantissa moves forward