Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
322846 董峻昊 【C6-2】正整数n转换为16进制 C++ 解答错误 0 1 MS 260 KB 243 2025-05-17 14:08:32

Tests(0/2):


#include<bits/stdc++.h> using namespace std; string s; int main(){ int n; cin>>n; char c; if(n==0) s="0"; while(n>0){ if(n%16>=10){ c=n%16+'A'-10; } c=n%16+'0'; s=c+s; n=n/16; } cout<<s; return 0; }


测评信息: