All pastes #34815 Raw Edit

Casanova

public text v1 · immutable
#34815 ·published 2005-12-24 21:37 UTC
rendered paste body
/*
 * This Program has been written by
 *                    Prashanth Mohan <prashmohan@gmail.com>
 *
 * This Program can be freely viewed, modified, distributed,
 * redistributed or any crap. It is not licensed in any manner not even
 * under the GPL ;-)
 *
 */


/* int main() */
/* { */
/*         int no,times=0; */
/*         int top,bot,mid; */
/*         scanf ("%d",&no); */
/*         top=no-1; */
/*         bot=1; */
/*         while (top-bot>1) { */
/*                 mid=(top+bot)/2; */
/*                 bot=mid; */
/*                 times++; */
/*         } */
/*         if (top-bot == 1) */
/*                 times ++; */
/*         if (top-bot != 0) */
/*                 times ++; */
/*         printf ("%d",times); */
/*         return 0; */
/* } */

#include <stdio.h>
#include <math.h>


int main()
{
        int num;
        int i,j;
        int total=0;
        scanf ("%d",&num);
        for (i=2;i<=num;i++) {
                total ++;
                for (j=2;j<num;j++)
                        if (j%i != 0)
                                total++;
        }
        total = log ((double)total)/log ((double)2);
        printf ("%d",total);
        return 0;
}