Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
83925 bc_zhanghanze 查找特定的值 C++ 通过 0 MS 244 KB 267 2026-02-04 12:22:29

Tests(1/1):


#include<iostream> using namespace std; int main(){ int n,x,i; cin>>n; int m[1000]; bool w=0; for(i=0;i<n;i++){ cin>>m[i]; } cin>>x; for(i=0;i<n;i++){ if(m[i]==x){ cout<<i+1; w=1; break; } } if(w==0){ cout<<"-1"; } }


测评信息: