回复 10楼 叶纤
大佬大佬
回复 4楼 rjsp
#include<iostream> #include<string> using namespace std; int main(){ string s; int m=16; cin>>s; string temp1=s; int len=s.length(); int weight = 1, asw = 0; for(int i=len-1;i>=0;i--){ if(s[i]<='9') asw=asw+(s[i]-'0')*weight; else asw=asw+(s[i]-'A'+10)*weight; weight*=m; } cout<<asw<<" "; for(int i=0;i<len;i++){ cout<<s[i]; } return 0; }