WA 50分求调
查看原帖
WA 50分求调
677002
_molee_楼主2023/11/9 12:38

记录

#include<bits/stdc++.h>
using namespace std;
long long q=1,s;
string a,z;
int main(){
	cin>>a;
	int l=a.size();
	for(int i=l-1;i>=0;i--)
	{
		s+=int(a[i]-'0')*q;
		q*=8;
	}
	while(s)
	{
		char c;
		if(s%16<10)
		{
			c=char(s%16+'0');
		}
		else
		{
			c=char(s%16-10+'a');
		}
		s/=16;
		z=c+z;
	}
	cout<<z;
	return 0;
}
2023/11/9 12:38
加载中...