题解 | #图像相似度#
图像相似度
https://www.nowcoder.com/practice/f2952ee3bb5c48a9be6c261e29dd1092
#include <stdio.h> int main() { int m,n; int i,j; double count=0.0; scanf("%d %d",&m,&n); int arr1[m][n]; int arr2[m][n]; for(i=0;i<m;i++) { for(j=0;j<n;j++) { scanf("%d",&arr1[i][j]); } } for(i=0;i<m;i++) { for(j=0;j<n;j++) { scanf("%d",&arr2[i][j]); } } for(i=0;i<m;i++) { for(j=0;j<n;j++) { if(arr1[i][j]==arr2[i][j]) count++; } } printf("%.2lf",count/(m*n)*100); return 0; }