Login
Immutable PageDiscussionInfoAttachments
rei05/C言語/10030

MMA

   1 #include<stdio.h>
   2 int main()
   3 {
   4         int n,q,i,k,l,count=0;
   5 
   6         scanf("%d",&n);
   7         int s[n];
   8         for(i=0;i<n;i++){
   9                 scanf("%d",&s[i]);
  10         }
  11 
  12         scanf("%d",&q);
  13         int t[q];
  14         for(i=0;i<q;i++){
  15                 scanf("%d",&t[i]);
  16         }
  17 
  18         for(k=0;k<n;k++)
  19                 for(l=0;l<q;l++)
  20                         if(s[k]==t[l]){
  21                                 count++;
  22                                 break;
  23                         }
  24 
  25         printf("%d\n",count);
  26 
  27         return(0);
  28 }

rei05/C言語/10030 (last edited 2012-06-01 16:48:08 by rei05)