mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-25 16:52:00 +00:00
P2084 进制转换
R44524974
This commit is contained in:
parent
5f95dcae95
commit
ec292fa03d
21
problem/P2084/P2084.cpp
Normal file
21
problem/P2084/P2084.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user