Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
322783 李韩韬 【C6-2】正整数N转换成一个二进制数 C++ 通过 100 1 MS 264 KB 227 2025-05-17 13:47:54

Tests(3/3):


#include <iostream> using namespace std; string s; int main(){ int n; cin>>n; char c; if(n==0){ s="0"; } while(n>0){ c=n%2+'0'; s=c+s; n=n/2; } cout<<s; return 0; }


测评信息: