1. 程式人生 > >oj---九度oj---1052

oj---九度oj---1052

can class res return cst ring code printf log

#include<cstdio>
#include<cstring>
int buf[205];

int main(){
    int n; 
    int x;
    while(scanf("%d",&n)!=EOF){
        for(int i=0;i<n;i++){
            scanf("%d",&buf[i]);
        }
        scanf("%d",&x);
        int res=-1;
        for(int i=0;i<n;i++){
            
if(x==buf[i]){ res=i; break; } } printf("%d\n",res); } return 0; }

oj---九度oj---1052