U E D R , A S I H C RSS

Power Of Cryptography/이영호

- . 한 . "/10" .


... .


p 1834567891242341235423542542451234145678551475585744

k = log(n root string:p)
// 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;
}
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:24:01
Processing time 0.0196 sec