0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-26 04:31:58 +00:00

P2084 进制转换

R44524974
This commit is contained in:
Baoshuo Ren 2021-01-02 15:00:59 +08:00 committed by Baoshuo Ren
parent 5f95dcae95
commit ec292fa03d
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

21
problem/P2084/P2084.cpp Normal file
View File

@ -0,0 +1,21 @@
#include <bits/stdc++.h>
using namespace std;
int m;
string s;
int main() {
cin >> m >> s;
for (int i = 0; i < s.size(); i++) {
if(s[i] == '0') {
continue;
}
if (i != 0) {
cout << '+';
}
cout << s[i] << '*' << m << '^' << s.size() - i - 1;
}
cout << endl;
return 0;
}