代码示例:
#include<cstdio> int main() { int m,n,number; int search; int arr[2000001]={0}; scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) { scanf("%d",&arr[i]); // arr[i]=number; }; while(m--) { scanf("%d",&search); printf("%d\n",arr[search]); } return 0; }
代码示例:
#include<cstdio> int main() { int m,n,number; int search; int arr[2000001]={0}; scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) { scanf("%d",&arr[i]); // arr[i]=number; }; while(m--) { scanf("%d",&search); printf("%d\n",arr[search]); } return 0; }