解题思路:
注意事项:
参考代码:
#include <iostream>
using namespace std;
int main() {
double a;
int e;
double b=3;
int c=0;
cin>>a;
e=a;
int m[20]={0};
int d=a;
while (b>1){
b=a/10;
a=b;
c++;
}
cout<<c<<endl;
for (int i=1;i<=c;i++){
m[i]=d%10;
d=d/10;
}
for (int i=c;i>0;i--)
{
cout<<m[i]<<" ";
}
cout<<endl;
for (int i=1;i<=c;i++){
cout<<e%10;
e=e/10;
}
return 0;
}
0.0分
2 人评分