I need a way to get a number from the user, break that number up (eg. 1128 into 1 1 2 and 8), and then manipulate each number. Here is what I tried to do, failed horribly:
#include <iostream>
#include <string>
#include <cmath>
int main()
{
string str;
int a = 0;
cout << "Number: " << endl;
cin >> str;
for(int i = 0,i2 = 1; i < str.length(); i++, i2++)
{
int x = pow(16.0, i);
int y = str[i2];
cout << y << ", ";
cout << x << ", ";
a += (h_str[h_str.length() -i2]) *x;
cout << a << endl;
}
cout << sum << endl;
}