Relative Frequency

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Each line follows the format: (character C)(space)(string S)
Print the relative frequency of C in S, to 6 decimal places.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

X XYXXXXYXXXXYYY
X XYXXXYYYYX
X YYXYYYY
Y XYXYXXXXXYYYXYX
X XXXXYYYY
Y YXYYYYYXYXX
X YYYXXXYY
X YYYY
Y XYXXYYYXXXXXYYYYYYYY

Sample output:

0.642857
0.500000
0.142857
0.400000
0.500000
0.636364
0.375000
0.000000
0.600000

Sample input:_

A ABCABCABCABC
1 000110011101
e dependencies
z zyzzyva
9 3.141592653589793238462643383279502884197169399
0 1.000001002003004005006007008009010

Sample output:

0.333333
0.500000
0.333333
0.428571
0.170213
0.657143

Sample input:_

s She sells seashells by the seashore.
a anarchygolf
7 2.71828182845904523536028747135266249775724709369995957496
n abcdefghijklmnopqrstuvwxyz

Sample output:

0.194444
0.181818
0.137931
0.038462

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid480.03682013/04/18 03:34:480B / 17B / 27B
2clock480.04552013/04/29 19:02:440B / 14B / 30B
3jbb520.03672013/05/01 01:52:230B / 19B / 29B
4Histocrat540.04542013/04/23 01:05:240B / 19B / 32B

Perl _

RankUserSizeTimeDateStatistics
1teebee400.03392013/04/18 15:58:390B / 16B / 23B
2whio400.03562013/04/19 06:44:100B / 15B / 23B
3brx400.04622013/04/27 01:31:450B / 16B / 21B
4BioFALSE780.04582013/04/18 21:40:151B / 30B / 46B
5whio(teebee)390.03722013/05/02 02:42:590B / 15B / 22B

Python _

RankUserSizeTimeDateStatistics
1leonid610.09352013/04/18 04:53:350B / 34B / 26B
2clock610.11022013/04/18 13:15:530B / 34B / 26B
3Hendrik610.09362013/04/18 19:22:090B / 34B / 26B
4xsot610.10572013/04/18 20:57:390B / 34B / 26B
5teebee610.10732013/04/21 01:57:460B / 34B / 26B
6rolf610.21512013/04/21 20:13:070B / 34B / 26B
7twobit610.17722013/04/22 21:50:140B / 34B / 26B
8Volatility650.10502013/04/18 07:00:520B / 36B / 28B
9jamesaxl720.09772013/04/24 00:07:570B / ?B / ?B
10govind850.10412013/04/24 03:49:460B / ?B / ?B

Scheme _

RankUserSizeTimeDateStatistics
1kaki1190.43142013/04/19 13:29:000B / 73B / 42B

Common LISP _

RankUserSizeTimeDateStatistics
1youz770.14982013/04/24 12:23:070B / 45B / 29B

Arc _

RankUserSizeTimeDateStatistics
1youz523.14642013/04/24 12:23:160B / 32B / 15B

Io _

RankUserSizeTimeDateStatistics
1pooq1110.21632013/04/18 10:48:070B / 83B / 23B

JavaScript _

RankUserSizeTimeDateStatistics
1copy720.04842013/04/18 03:14:400B / 41B / 29B
2Shmiddty720.04562013/04/18 04:29:210B / 41B / 29B
3clock720.05832013/04/19 20:41:540B / 41B / 29B

Lua _

RankUserSizeTimeDateStatistics
1twobit740.03752013/04/22 22:24:010B / 45B / 28B
2clock760.03672013/04/19 20:26:550B / 45B / 29B
3Hendrik760.05122013/04/19 21:09:150B / 41B / 34B

J _

RankUserSizeTimeDateStatistics
1I., S.(alt)330.10332013/04/20 06:01:460B / 13B / 19B
2I., S.340.06872013/04/19 21:29:040B / 10B / 24B
3random360.06692013/04/18 04:45:490B / ?B / ?B
4pooq410.17222013/04/19 17:11:300B / 11B / 30B

K _

RankUserSizeTimeDateStatistics
1clock280.03512013/04/19 19:26:300B / 9B / 18B
2teebee280.03812013/04/21 01:11:520B / 8B / 19B
3twobit280.02602013/04/22 22:27:260B / 8B / 20B

C _

RankUserSizeTimeDateStatistics
1inaniwa850.03212013/04/21 09:54:590B / 41B / 44B
2nu850.03252013/04/23 02:02:280B / 41B / 44B
3TokusiN850.03212013/04/27 01:52:510B / 42B / 43B
4ush880.03712013/04/18 12:52:010B / 41B / 47B
5twobit890.03502013/04/23 05:36:530B / 42B / 47B
6pandamonium890.03212013/04/25 08:24:180B / 43B / 46B
7chocobi970.03202013/04/18 21:58:470B / 46B / 51B
8orangetide1000.03462013/04/20 05:33:370B / 50B / 49B
9TokusiN840.03822013/05/13 12:05:080B / 41B / 43B

Rust _

RankUserSizeTimeDateStatistics
1klapaucius1200.04442013/04/24 18:21:370B / ?B / ?B
2Kroisse1210.04102013/04/24 16:05:330B / 72B / 45B
3teebee1320.04582013/04/24 09:35:160B / 79B / 48B
4Panda2770.05752013/04/22 06:31:530B / ?B / ?B
5kaeso3110.04592013/04/24 05:28:4314B / ?B / ?B
6teebee(klapaucius)1190.04192014/01/13 02:14:010B / 67B / 49B

Haskell _

RankUserSizeTimeDateStatistics
1henkma890.04082013/04/19 21:18:500B / 56B / 31B
2cojna890.04012013/04/22 01:08:410B / 56B / 31B
3unno1000.03932013/04/24 16:11:120B / 53B / 45B
4Lost_dog1000.04762013/04/26 14:36:070B / 60B / 37B
5twobit1070.03642013/04/24 00:22:570B / 60B / 40B

Java _

RankUserSizeTimeDateStatistics
1mulder_fbi4070.24832013/09/28 05:10:051B / 241B / 151B

Maxima _

RankUserSizeTimeDateStatistics
1pooq1040.98972013/04/21 09:55:390B / 55B / 47B

AWK _

RankUserSizeTimeDateStatistics
1teebee400.03252013/04/18 15:48:220B / 22B / 18B
2clock400.03942013/04/19 20:37:390B / 22B / 18B
3nn400.03372013/04/22 08:51:110B / 23B / 17B
4eban420.03572013/04/23 13:51:430B / 23B / 19B

Zsh _

RankUserSizeTimeDateStatistics
1eban570.03782013/04/23 14:56:410B / 30B / 20B
2eban550.15312013/05/02 11:08:010B / 29B / 19B

Groovy _

RankUserSizeTimeDateStatistics
1teebee632.77152013/04/21 02:28:300B / 42B / 21B
2clock632.81712013/04/22 08:50:180B / 41B / 22B

Language Ranking_

RankLangUserSizeScore
1Kclock2810000
2JI., S.(alt)338484
3Perlwhio(teebee)397179
4AWKteebee407000
5Rubyleonid485833
6Arcyouz525384
7Zsheban555090
8Pythonleonid614590
9Groovyteebee634444
10JavaScriptcopy723888
11Luatwobit743783
12Common LISPyouz773636
13CTokusiN843333
14Haskellhenkma893146
15Maximapooq1042692
16Iopooq1112522
17Schemekaki1192352
18Rustteebee(klapaucius)1192352
19Javamulder_fbi407687

return top