Skip to content

Commit ba8860a

Browse files
committed
Added 1352A - Sum of Round Numbers.cpp
1 parent 8475d59 commit ba8860a

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

1352A - Sum of Round Numbers.cpp

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
bool checkRound(int x)
10+
{
11+
if(x <= 10 && x>0)
12+
return true;
13+
if(x % 10 == 0)
14+
return true;
15+
return false;
16+
}
17+
18+
int main()
19+
{
20+
int t;
21+
cin>>t;
22+
while(t--)
23+
{
24+
int n;
25+
cin>>n;
26+
int c = 0;
27+
vector<int> s;
28+
int i = 0;
29+
while(n!=0)
30+
{
31+
if(n%10!=0)
32+
{
33+
int ans = pow(10,i);
34+
ans *= (n%10);
35+
s.push_back(ans);
36+
}
37+
n /= 10;
38+
i++;
39+
}
40+
cout<<s.size()<<endl;
41+
for(int i = 0; i<s.size(); i++)
42+
{
43+
cout<<s[i]<<" ";
44+
}
45+
cout<<endl;
46+
}
47+
return 0;
48+
}
49+

0 commit comments

Comments
 (0)