#include<stdio.h> #include<math.h> int main() { const unsigned base = 6; unsigned i = 0; unsigned tech,j; while(1) { tech = 0; j = i; while(j) { ++tech; j/=10; } if((i*10+base)*4 == base*pow(10,tech)+i) break; i++; } printf("found answerd:%u\n",(i*10+base)*4); }
#include <stdio.h> // 由 d + x = 4 * (x*10+6),其中 d=60,600,6000,…… // 推导出 x = (d-24)/39 int main( void ) { unsigned d; for( d=60; (d-24)%39; d*=10 ); printf( "%u\n", d+(d-24)/39 ); return 0; }
[此贴子已经被作者于2016-6-5 12:55编辑过]