Sample Solution void process(int n) { int k, e;
{"Image DocumentName": "Sample Solution void process(int n) { int k, e;", "Image ImageDescription": "double d1, d2, d3, d4; double left, right; d4 = log(2); d3 = log(10) / d4; d1 = log(n) / d4; d2 = log(n+1) / d4; k = length(n)+1; left = d1+k d3; right = d2+k d3; e = (int)ceil(left); while(e >= right) k++; } printf( %d\\n , e); #include <stdio.h> #include <stdlib.h> #include <math.h> void process(int); int length(int); int main() { int in; while( scanf( %u , &in) != EOF) process(in); return 0; } int length(int n) { int len = 0; if(n < 10) return 1; while(n > 0) n = n/10; len++; } return len;", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}