0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-10 08:18:49 +00:00
OI-codes/Luogu/P2084/P2084.cpp

21 lines
355 B
C++
Raw Normal View History

2021-01-02 07:00:59 +00:00
#include <bits/stdc++.h>
using namespace std;
int m;
string s;
int main() {
cin >> m >> s;
for (int i = 0; i < s.size(); i++) {
2021-11-19 09:01:13 +00:00
if (s[i] == '0') {
2021-01-02 07:00:59 +00:00
continue;
}
if (i != 0) {
cout << '+';
}
cout << s[i] << '*' << m << '^' << s.size() - i - 1;
}
cout << endl;
return 0;
}