Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- void main()
- {
- int
- number = NULL,
- temp = NULL,
- count = 1;
- string
- input;
- cout << "Please enter a number: ";
- getline(cin, input);
- number = temp = abs(atoi(input.c_str()));
- while((number = number/10) > 0)
- {
- count++;
- }
- number = temp;
- cout << number << " has " << count << " places." << endl;
- getline(cin,input);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement