标签:main stream using 转化 ace pre turn highlight int
#include<iostream> using namespace std; int main() { string n; int m, len, i, ans = 0; cin >> n >> m; len = n.length(); for (i = 0; i < len; i++) { if (n[i] <= ‘9‘) ans = ans * m + n[i] - ‘0‘; else ans = ans * m + n[i] - ‘A‘ + 10; } cout << ans << endl; return 0; }
标签:main stream using 转化 ace pre turn highlight int
原文地址:https://www.cnblogs.com/zhanghua-322/p/11302378.html