标签:span -- std ++ return nbsp while log include
AC:
#include<stdio.h> int a[100]; int n,m; int main() { int i=0,j=0; int k; while(scanf("%d",&n)!=EOF) { for (i=0;i<n;i++) scanf("%d",&a[i]); scanf("%d",&m); for (j=0;j<m;j++) { int flag=0; scanf("%d",&k); for(i=0;i<n;i++) if (a[i]==k) { flag=1;break; } if (flag==1) printf("YES\n"); else printf("NO\n"); } } return 0; }
题目1173:查找-----------------虽然题干中给出的是两个数组的形式,但是m以后的输入可以不用数组来接收,这是scanf的好处!
标签:span -- std ++ return nbsp while log include
原文地址:http://www.cnblogs.com/jianrenguo/p/6537642.html