图像相似度
图像相似度
http://www.nowcoder.com/questionTerminal/f2952ee3bb5c48a9be6c261e29dd1092
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int m = sc.nextInt(), n = sc.nextInt(), i = 0, sum = 0;
int[] v = new int[m*n];
while (i < m*n) v[i++] = sc.nextInt();
i = 0;
while (i < m*n) sum += (v[i++] + sc.nextInt())%2;
System.out.printf("%.2f", (1 - (double)sum/m/n)*100);
}
}
查看15道真题和解析