标签:++ 除了 names include space bit ORC int 题目
将一个除了首位,其余为都为0的数成为round
,先给一个数n,求出可以拆分成多少个round
数
#include<bits/stdc++.h>
using namespace std;
int main(){
int t = 0;
int n = 0;
cin>>t;
for(int i = 0; i < t; i++){
scanf("%d", &n);
int num = 0;
int ans = 0;
string str = to_string(n);
int len = str.size();
for(int i = 0; i < len; i++){
if(str[i] != ‘0‘) num++;
}
printf("%d\n",num);
for(int i = 0; i < len; i++){
if(str[i] != ‘0‘){
ans = (str[i] - ‘0‘) * pow(10,len - i - 1);
printf("%d ",ans);
}
}
printf("\n");
}
return 0;
}
Codeforces Round #640 (Div. 4)
标签:++ 除了 names include space bit ORC int 题目
原文地址:https://www.cnblogs.com/whisperbb/p/12885824.html