#include<iostream> using namespace std; int main() { int n,m,v; int *s; int f=1; int count=1,c=0; cout<<"input the number : "<<endl; cin>>n; //计算位数 while(n/10!=0) { n=n/10; f=f*10; count++; } //while(m%10==0){m=m/10;count--;f=f/10;}(不显示0) while(m%10==0){m=m/10;c++;f=f/10;}//(显示出0) s=new int[count]; int i=count-1; while(m!=0)//求出各个位数 { s[i]=m/f; m=m%f; f=f/10; i--; } cout<<"show the resultL: "<<endl; for(int k=0;k<c;k++) s[k]=0; for(int j=0;j<count;j++) cout<<s[j]<<'\t'; delete [] s; cout<<endl; return 0;}