#include <stdio.h>
#include <stdlib.h>
//線形探索
int linear_search(int a[],int n,int x){
int i,count=0,ret=-1;
for(i=0;i<n;i++){
if(a[i]==x){
ret=i;
count++;
}
}return count;
}
int main(void) {
int n,x,i;
int *a;
int ans = -1;
a
= (int*)malloc(sizeof(int)*n
); if(a==NULL){
return -1;
}
for(i=0;i<n;i++){
}
ans = linear_search(a,n,x);
if(ans
!= 0) printf("Found_%d_%ds\n",ans
,x
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KIAovL+e3muW9ouaOoue0ogppbnQgbGluZWFyX3NlYXJjaChpbnQgYVtdLGludCBuLGludCB4KXsKCWludCBpLGNvdW50PTAscmV0PS0xOwoJZm9yKGk9MDtpPG47aSsrKXsKCQlpZihhW2ldPT14KXsKCQkJcmV0PWk7CgkJCWNvdW50Kys7CgkJfQoJfXJldHVybiBjb3VudDsKfQogCmludCBtYWluKHZvaWQpIHsKCWludCBuLHgsaTsKCWludCAqYTsKCWludCBhbnMgPSAtMTsKCXNjYW5mKCIlZCAlZCIsJm4sJngpOwoJYSA9IChpbnQqKW1hbGxvYyhzaXplb2YoaW50KSpuKTsKCWlmKGE9PU5VTEwpewoJCXByaW50ZigiRVJST1JcbiIpOwoJCXJldHVybiAtMTsKCX0KCWZvcihpPTA7aTxuO2krKyl7CgkJc2NhbmYoIiVkIiwmYVtpXSk7Cgl9CglhbnMgPSBsaW5lYXJfc2VhcmNoKGEsbix4KTsKCWlmKGFucyAhPSAwKSBwcmludGYoIkZvdW5kXyVkXyVkc1xuIixhbnMseCk7CgllbHNlIHByaW50Zigibm90IGZvdW5kXG4iKTsKCWZyZWUoYSk7CglyZXR1cm4gMDsKfQ==
NTAgNQoxMgkzCTQJMTIJMTEJNQk3CTE1CTE4CTAJMAk1CTEwCTYJMTUJNgk0CTEwCTgJMTYJMTIJOQkxMAkxMQkxMgk5CTUJNwkxMAkxNAkzCTE3CTExCTEwCTcJMTUJNQkyCTYJMwkxOQk3CTgJMTYJMTMJMwkxOAkxMAkxOQk1
50 5
12 3 4 12 11 5 7 15 18 0 0 5 10 6 15 6 4 10 8 16 12 9 10 11 12 9 5 7 10 14 3 17 11 10 7 15 5 2 6 3 19 7 8 16 13 3 18 10 19 5