Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6965 | 詹梓涵 | 18排列骨头 | C++ | Compile Error | 0 MS | 0 KB | 487 | 2025-03-29 12:43:21 |
#include<bits/stdc++.h> using namespace std; int a[31],a,b; int main(){ while(b<15){ for(int i=1;i<=30;i++){ if(a[i]==0){ a++; if(a==10){ a=1; } if(a==9){ a[i]=1; b++; } } } } for(int i=1;i<=30;i++){ if(a[i]==1){ cout<<i<<" "; } } return 0; }
Main.cc:3:11: error: conflicting declaration 'int a' int a[31],a,b; ^ Main.cc:3:5: error: 'a' has a previous declaration as 'int a [31]' int a[31],a,b; ^ Main.cc: In function 'int main()': Main.cc:8:17: error: lvalue required as increment operand a++; ^ Main.cc:9:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(a==10){ ^ Main.cc:10:21: error: incompatible types in assignment of 'int' to 'int [31]' a=1; ^ Main.cc:12:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(a==9){ ^