- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoundNum.cpp
More file actions
Latest commit
30 lines (29 loc) · 521 Bytes
/
Copy pathRoundNum.cpp
File metadata and controls
30 lines (29 loc) · 521 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include<bits/stdc++.h>
#definelllonglongint
#defineendl"\n"
usingnamespacestd;
intmain(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ll t;
cin>>t;
while(t--){
ll n;
cin>>n;
vector<ll>ans;
ll power = 1;
while(n > 0){
if(n%10>0){
ans.push_back((n%10)*power);
}
n = n/10;
power *= 10;
}
cout<<ans.size()<<endl;
for(auto number : ans) cout<<number<<"";
cout<<endl;
}
return0;
}