21 lines
504 B
Plaintext
21 lines
504 B
Plaintext
open "text.txt" for input as #i
|
|
txt$ =input$( #i, lof( #i))
|
|
Le =len( txt$)
|
|
close #i
|
|
|
|
dim LetterFreqy( 255)
|
|
|
|
' txt$ =upper$( txt$)
|
|
|
|
for i =1 to Le
|
|
char =asc( mid$( txt$, i, 1))
|
|
if char >=32 then LetterFreqy( char) =LetterFreqy( char) +1
|
|
next i
|
|
|
|
for j =32 to 255
|
|
if LetterFreqy( j) <>0 then print " Character #"; j, "("; chr$( j);_
|
|
") appeared "; using( "##.##", 100 *LetterFreqy( j) /Le); "% of the time."
|
|
next j
|
|
|
|
end
|