- . 가 류를 바로 . "/10" 로 나 .
... 공 군.
p를 1834567891242341235423542542451234145678551475585744로 가
k = log(n root string:p)
// p를 string로
// p를 string로
= 1/n * log(string:p)
// n 밖로 낸다.= 1/n * ( log( 10 (string:p 릿)) + log((x) = string:p 맨 두 를 리로 것 반림. -> 1.8) )
// 반림 ceil, floor 로 게 구다.// 기 문를 로 변경고 log10 를 다.
// 반림 고 바로 log10 됨.
= 1/n * ( 릿 + log(x) )
= 끝.
// 반림 고 로 다.= 끝.
기 때문 것 맞떨.
령 래 로그로 근값 맞 떨. (반림 면됨)
령 래 로그로 근값 맞 떨. (반림 면됨)
~cpp // 개략 딩로 러가 러를 못. // 는 func(). n, p를 들고 k를 반. // 6 44 딩 // 6 57 끝. #include <stdio.h> #include <string.h> #include <math.h> int func(char *p, int n){ double ret_buf; int ret; int t = strlen(p)-1; double buf; char p_buf[3]; sscanf(p_buf, "%2c\0", p); // 두 리만 다. buf = log10((double)atof(p_buf)/10); // 두리를 log다. ret_buf = (buf+t)/n; if(ret_buf >= (ceil(ret_buf)+floor(ret_buf))/2) // 반림. 림+내림/2보다 나 같 경 ret_buf = (int)ret_buf + 1; // 림. ret = (int)ret_buf; // 내림경 기 로 내린다. return ret; }