📄 monocryptanalysis.java
字号:
import java.io.*;
import java.util.*;
public class MonoCryptanalysis {
public static void main(String[] args)throws Exception {
FileReader fr = new FileReader("Mono_cipher.txt");
int count[] = new int[26];
int total=0;
int temp;
double fe;
while((temp=fr.read())!=-1){
if(temp>=65&&temp<=90){
count[temp-65]++;
total++;
}
}
for (int i = 0; i < 26; i++) {
fe = (double)count[i]*100/(double)total;
System.out.println("Frequent of "+(char)(i+65)+" : "+fe);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -