Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
40538 闻航 图像相似度 C++ 通过 0 MS 260 KB 710 2024-02-12 15:12:32

Tests(1/1):


#include<iostream> #include<iomanip> using namespace std; int main() { int m, n; int image1[100][100]; int image2[100][100]; float diff = 0; cin >> m >> n; //赋值 for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cin >> image1[i][j]; } } for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { cin >> image2[i][j]; } } for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { if (image1[i][j] == image2[i][j]) diff++; } } cout << fixed << setprecision(2) << diff / (m * n) * 100 << endl; return 0; }


测评信息: