string s = "ababcdefaceAVAXC";
char[] ch = new char[s.Length];
int [] ascii = new int [52];
s.CopyTo(0, ch, 0, s.Length);
foreach (char c in ch)
{
ascii[(int)c - 65]++;
}
private Dictionary<string, int> CountLetters(string line)
{
Dictionary<string, int> ret = new Dictionary<string, int>();
char[] chars = line.ToCharArray();
foreach (char c in chars)
{
Regex regex = new Regex(c.ToString());
ret[c.ToString()] = regex.Matches(line).Count;
}
return ret;
}
private int AvgValue(string line, out int result)
{
float sum = 0;
int ret = 0;
result = 0;
string[] pieces = line.Split(',');
int len = pieces.Length;
foreach (string piece in pieces)
{
sum += float.Parse(piece);
}
ret = (int)(sum / (float)len);
float temp = sum / len;
pieces = temp.ToString().Split('.');
if (pieces.Length > 1)
{
char[] chars = pieces[1].ToCharArray();
if (int.Parse(chars[0].ToString()) > 4) result = ret + 1;
else result = ret;
}
else result = ret;
/////////
for (int i = 0; i < s1.Length; i++)
{
if(ht.ContainsKey(s1[i].ToString()))
{
int ii = (int)ht[s1[i].ToString()];
ht[s1[i].ToString()] = ii + 1;
}
else
{
ht.Add(s1[i].ToString(), 1);
/////////
for (int i = 0; i < s1.Length; i++)
{
if(ht.ContainsKey(s1[i].ToString()))
{
int ii = (int)ht[s1[i].ToString()];
ht[s1[i].ToString()] = ii + 1;
}
else
{
ht.Add(s1[i].ToString(), 1);
string[] ss = s2.Split(',');
int iCount = 0;
double dAve = 0.0;
for (int i = 0; i < ss.Length; i++)
{
iCount += int.Parse(ss[i]);
}
//average
dAve = iCount / ss.Length;
double dP = double .MaxValue ;
for (int i = 0; i < ss.Length; i++)
{
int iTemp = (int)Math.Abs(int.Parse(ss[i]) - dAve);
class Program
{
static void Main(string[] args)
{
while (true)
{
string input = Console.ReadLine();
if (input.Length == 0) break;
List<LetterKey> result = new List<LetterKey>();
for (int i = 0; i < input.Length; i++)
{
LetterKey letterKey = new LetterKey(input[i]);
int index = result.IndexOf(letterKey);
if (index == -1)
{
result.Add(letterKey);
}
else
{
result[index].Count++;
}
}
foreach (LetterKey lk in result)
{
Console.WriteLine(lk);
}
}
}
}
class LetterKey {
public char Letter;
public int Count;
public LetterKey(char letter) {
Letter = letter;
Count = 1;
}
public override string ToString()
{
return string.Format("字符:{0},出现次数:{1}.", Letter, Count);
}
public override bool Equals(object obj)
{
LetterKey eqObj = (LetterKey)obj;
return this.Letter.Equals(eqObj.Letter);
}
public override int GetHashCode()
{
return this.Letter.GetHashCode();
}
}