import java.io.File; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; public class a { public static void main(String args[]) { File f=new File("1.txt"); if(f.isFile()) { try { BufferedReader b=new BufferedReader(new FileReader(f)); StringBuffer sb=new StringBuffer(); String t; while((t=b.readLine())!=null) { sb.append(t+"/n"); } String s=sb.toString(); s.toLowerCase(); char tj[]=s.toCharArray(); int count[]=new int[26]; for(int i=0; i<s.length(); i++) { int j=tj[i]-'a'; if(j>=0&&j<26) { count[j]++; System.out.println(count[j]*1.0/(s.length()-1)); } } } catch(IOException e) { e.printStackTrace(); } } } }