1 solutions

  • 0
    @ 2025-10-25 13:41:19
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	if(n==0)
    	{
    		cout<<0;
    		return 0;
    	} 
    	string s;
    	while(n)
    	{
    		int t=n%16;
    		if(t<=9) s=s+char('0'+t);
    		else s=s+char('A'+t-10);
    		n/=16;
    	}
    	reverse(s.begin(),s.end());
    	cout<<s;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2852
    Time
    1000ms
    Memory
    512MiB
    Difficulty
    8
    Tags
    # Submissions
    20
    Accepted
    5
    Uploaded By