int MAX_NUM = 600851475143;
int max = 0;
vector <int> ints;
for(int i = 1; i <= MAX_NUM; ++i)
if((int)MAX_NUM % i == 0)
ints.push_back(i);
cout << "size = " << ints.size();
I get 0. Something is wrong. I get 2 warnings:
warning C4305: 'initializing' : truncation from '__int64' to 'int'
warning C4309: 'initializing' : truncation of constant value
So I did this:
__int64 MAX_NUM = 600851475143;
vector <__int64> ints;
for(__int64 i = 1; i <= MAX_NUM; ++i)
if((__int64)MAX_NUM % i == 0)
ints.push_back(i);
cout << "size = " << ints.size();
I don't get anything. I get an empty character "". Then cin.get() follows but it doesn't work.
How can I solve this?