提交时间:2024-09-28 15:24:43

运行 ID: 52194

#include<bits/stdc++.h> using namespace std; int main() { int m, n, s = 0, a[100][100], b[100][100]; cin >> m >> n; for(int i = 0; i < m; i++) for(int j = 0; j < n; j++) cin >> a[i][j]; for(int i = 0; i < m; i++) for(int j = 0; j < n; j++) cin >> b[i][j]; for(int i = 0; i < m; i++) for(int j = 0; j < n; j++) { if(a[i][j] == b[i][j]) s++; } cout << fixed << setprecision(2) << (double)s/(m*n)*100; return 0; }