Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160838 鸡哥 18第一次出现与最后一次出现的位置 C++ Compile Error 0 MS 0 KB 340 2026-09-26 15:14:46

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){//break continue int a[100],n,x,s=0,m=0; for(int i=1;i<=n;i++){ cin>>a[i]; } cin>>x; for(int i=1;i<=n;i++){ if(a[i] = x){ s=i; break;//break continue } } for(int i=n;i<=1;i++){ if(a[i] = x){ m=i; break; cout<<a<<" "<<m; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if(a[i] = x){
              ^
Main.cc:16:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if(a[i] = x){
              ^
Main.cc:21:1: error: expected '}' at end of input
 }
 ^
Main.cc:21:1: error: expected '}' at end of input