特判直接等于0的情况
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
string s;
ll a;
stack<int> q;
int main(){
cin>>a;
if(a==0){
cout<<"0"<<endl;
return 0;
}
while(a){
q.push(a%16);
a=a/16;
}
while(!q.empty()){
switch(q.top()){
case 10:cout<<'A';break;
case 11:cout<<'B';break;
case 12:cout<<'C';break;
case 13:cout<<'D';break;
case 14:cout<<'E';break;
case 15:cout<<'F';break;
default:cout<<q.top();break;
}
q.pop();
}
cout<<endl;
return 0;
}