⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 monocryptanalysis.java

📁 Java实现传统算法加密解密
💻 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 + -