Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
108106 | 刘泽熙 | 十进制转二进制 | C++ | Compile Error | 0 MS | 0 KB | 257 | 2025-01-19 14:27:59 |
#include<bits/stdc++.h> using namespace std; int y[32]; int cnt =0; int main(){ long long n; cin>>n; while(1){ int yu=n%2; y[cnt]=yu; cnt++; n=n/2; if(n==0){ break; } } for(int i=cnt-1;i>=-;i--){ cout<<y[i]; } }
Main.cc: In function 'int main()': Main.cc:18:22: error: expected primary-expression before ';' token for(int i=cnt-1;i>=-;i--){ ^