An alphabet frequency analysis calculation applet

xiaoxiao2021-03-06  47

/ / There is a simple method of analyzing password in cryptography, that is, calculates the frequency of each letter. This applet is the number of times of calculating each letter in the input // into the string, I am now studying Java, I Will send my usual small exercise to here, learn to progress together from the initiator. Master should not laugh ./**Auther starshus ** Date 04/11/20 * /// 6.7.5import java.io .BUFFEREDReader; import java.io.inputstreamReader;

Public class analysis; public analysis // Configuration method, convert all entered passwords to uppercase letters {Words = INPUT.TOUPPERCASE ();} PUBLIC INT GETNUM () // Returns the length of the password { Return Words.Length (); PUBLIC INT RESULT (CHAR C) // Method: Calculate the number of times of Character C in the password {String Temp = New String (Words); int index = Temp.indexof (c); int N = 0; while (index> = 0) {TEMP = Temp.substring (INDEX 1, TEMP.LENGTH ()); Index = Temp.indexOf (c); n ;} return n;} public static void main (String [] args) // Main method {system.out.print ("please input the words:"); // Enter Passwd string infutline; try {buffredreader in = new bufferedreader (NEW INPUTSTREADER (system.in); inputline = in.readline ();

转载请注明原文地址:https://www.9cbs.com/read-89430.html

New Post(0)