#include <iostream>
#include <cmath>
using namespace std;
void split(int num)
{
int n = num ;
int count = 0; //位数
int temp,power;
while(num != 0) //统计位数
{
num = num / 10;
count ++;
}
for(int i= 1;i <= count;i++) //提取n的各位
{
power = pow(10.0,count - i); //幂函数
temp = n / power;
cout<<temp<<endl;
n = n % power;
}
}
void main()
{
int num;
cout<<"Input a number:";
cin>>num;
split(num);
system("pause");
}