#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int buf[200];
int n;
int i;
while (cin >> n){
for (i = 0; i < n; i++){
cin >> buf[i];
}
int x, ans = -1;
cin >> x;
for (i = 0; i < n; i++)
if (x == buf[i])
{
ans = i;
break;
}
cout << ans << endl;
}
}
C++版本查找(找X问题)1052
最新推荐文章于 2024-08-01 20:13:16 发布