-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsol.cpp
69 lines (47 loc) · 1 KB
/
sol.cpp
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// https://a.hirepro.in/dF7LDQ0O
// User Name: Qualcomm241743760563
// Password: 9BtrYQqu
#include<bits/stdc++.h>
using namespace std;
vector<string> vec;
void split(string str, char del){
string temp = "";
for(int i=0; i<(int)str.size(); i++){
if(str[i] != del){
temp += str[i];
}
else
{
vec.push_back(temp);
temp = "";
}
}
}
int main()
{
string s;
cin >> s;
int n = s.size();
s += ",";
split(s,',');
string temp;
for(int i = 0;i<vec.size();i++)
{
int x = stoi(vec[i]);
int mn = x , j = 1;
while(mn < pow(10,x))
{
if(x*j >= pow(10,x))
{
break;
}
mn = x*j;
cout << mn << "\n";
j++;
}
temp = temp + to_string(mn);
if(i<vec.size()-1) temp += ",";
}
cout << temp;
return 0;
}