阅读下面程序,说明其功能。
main(){
int a[10],b[10],i,n=0,m=0,k=0;
printf("enter array a:
");
for(i=0;i<10;i++)
scanf("%d",&a[i]);
printf("
");
printf("enter array b:
");
for(i=0;i<10;i++)
scanf("%d",&b[i]);
printf("
");
for(i=0;i<10;i++){
if(large(a[i],b[i])==1)n=n+1;
else if(large(a[i],b[i])==0)m=m+1;
else k=k+1;
}
printf("a[i]>b[i] %d times
a[i]=b[i] %d times
a[i]<b[i] %d times
",n,m,k);
if(n>k)printf("array a is larger than array b
");
else if(n<k)printf("array a is smaller than array b ");
else printf("array a is equal to array b
");
}
int large(x,y){
int flag;
if(x>y)flag=1;
else if(x<y)flag=-1;
else flag=0;
return flag;
}