You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
315 B

#include<bits/stdc++.h>
using namespace std;
int main() {
int n,j,i=0;
char b[100];
scanf("%d",&n);
if(n==0) {
b[i]=48;
i++;
} else {
while(n)
{
b[i]=n%16;
n=n/16;
if(b[i]>9) {
b[i]+=55;
} else {
b[i]+=48;
}
i++;
}
}
for(j=i-1; j>=0; j--)printf("%c",b[j]);
return 0;
}