syat #7089(2008/08/10 05:38 GMT) [ C# ] Rating1/1=1.00
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
using System; using System.Text.RegularExpressions; class P { static void Main() { var d = new System.Collections.Generic.Dictionary<String, int>(); var n = 1; for (var s = "" ; (s = Console.ReadLine()) != null ; n++) new Regex("\\w+").Replace(s, delegate(Match m) { var k = m.ToString(); if (!d.ContainsKey(k)) d[k] = n; return k; }); foreach (var k in d) Console.Write("{0}: {1}\n", k.Key, k.Value); } }
Rating1/1=1.00-0+
[ reply ]
syat
#7089()
[
C#
]
Rating1/1=1.00
そういえば C#ってカンマ演算子使えないんですね。短くならないわけだ。
Rating1/1=1.00-0+
[ reply ]