/*20140720 hanting*/
#include <iostream>
#include <iomanip>
#include <sstream>
using namespace std;
int main()
{
string s;
while(getline(cin,s) && s[0]!='-')
{
stringstream ss;
long long int a;
if(s[1]=='x')
{
ss<<s;
ss>>hex>>a;
cout<<dec<<a<<endl;
}
else
{
ss<<s;
ss>>a;
cout<<"0x"<<hex<<uppercase<<a<<endl;
}
}
return 0;
}
沒有留言:
張貼留言