[ create a new paste ] login | about

Link: http://codepad.org/Aq3eL3MB    [ raw code | output | fork ]

C++, pasted on Jan 8:
1
2
3
4
5
6
7
8
#include "math.h"

int main()
{
    int i[] = { 1, 9, 10, 11, 99, 123, 888, 10001 };
    for (int x = 0; x < 8; x++)
        printf("%d ", (int)log10(i[x] * 10));
}


Output:
1
1 1 2 2 2 3 3 5 


Create a new paste based on this one


Comments: