Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main(){
- char a, b, c;
- cout<<"Enter a 3 digit number:" << endl;
- cin>> a >> b >> c;
- while(cin != 'n'){
- cout<< "3 digits only" << endl;
- }
- cout<< a << " " << b << " " << c << endl;
- string num;
- cout<<"Enter a any digit number:" << endl;
- cin>> num;
- char* array = &num[0];
- int total = num.length();
- for(int i = 0; i < total; i++){
- cout<< array[i] << " ";
- }
- }
- Enter a 3 digit number:
- 123
- 1 2 3
- Enter a any digit number:
- 191843564
- 1 9 1 8 4 3 5 6 4 %
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement