Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
2422 | 莫业祁 | 18第一次出现与最后一次出现的位置 | C++ | Compile Error | 0 MS | 0 KB | 331 | 2024-01-06 14:40:00 |
# include<iostream> using namespace std; int main(){ int n,m,a[n],b[0],c=0; cin>>n; for(int i=0;i<n;i++) cin>>a[n]; cin>>m; for(int i=0;i<n;i++){ if(a[i]=m){ a[i]=b[c]; c+1; } cout<<b[0]<<" "<<b[c] } return 0; }
Main.cc: In function 'int main()': Main.cc:11:18: warning: suggest parentheses around assignment used as truth value [-Wparentheses] if(a[i]=m){ ^ Main.cc:13:14: warning: statement has no effect [-Wunused-value] c+1; ^ Main.cc:18:5: error: expected ';' before '}' token } ^