language: C++ 4.7.2 (gcc-4.7.2)
date: 902 days 4 hours ago
link:
visibility: private
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <climits>
#include <string>
#include <sstream>
 
template<typename T>
std::string itostr(T val)
{
    std::stringstream s;
    s << val;
    return s.str();
}
 
#include <iostream>
int main(void)
{
    int i = 0;
    i += itostr(INT_MIN).size();
    i += itostr(INT_MAX).size();
 
    i += itostr(unsigned(INT_MAX) + 1U).size();
    i += itostr(unsigned(~0)).size(); 
 
        char c = CHAR_MIN;
        do {
                i += itostr(c).size();
                i += itostr((11111111 * c)).size();
 
                if (c >= CHAR_MAX) break;
 
                c++;
        } while (1);
 
    while (i < 10000000)
        i += itostr(i).size();
 
    std::cout << i << std::endl;
 
    return i;
}