fork download
  1. <?php
  2. $letters = array();
  3. for ($i=0; $i<1000000; $i++){
  4. $c=chr(65+rand(0,675)**.5);
  5. $letters[$c] = isset($letters[$c])?$letters[$c]+1:1;
  6. }
  7.  
  8. ksort($letters);
  9.  
  10. foreach ($letters as $l=>$n){
  11. echo $l.": ".($n/array_sum($letters)*100)."%\n";
  12. }
Success #stdin #stdout 0.52s 52488KB
stdin
Standard input is empty
stdout
A: 0.1395%
B: 0.4514%
C: 0.7413%
D: 1.0547%
E: 1.3382%
F: 1.6224%
G: 1.9253%
H: 2.2227%
I: 2.5176%
J: 2.7994%
K: 3.1009%
L: 3.394%
M: 3.6939%
N: 4.0137%
O: 4.292%
P: 4.5608%
Q: 4.9315%
R: 5.2023%
S: 5.4725%
T: 5.7485%
U: 6.0136%
V: 6.4375%
W: 6.614%
X: 6.9441%
Y: 7.2443%
Z: 7.5239%