题解 c#不能缺席| #字符个数统计#

字符个数统计

http://www.nowcoder.com/practice/eb94f6a5b2ba49c6ac72d40b5ce95f50

using System;
using System.Collections.Generic;

class Buchongfu
{
    static void Main()
    {
        Dictionary<int, char> Dic = new Dictionary<int, char>();

        string Zoo = Console.ReadLine();

        int Chang = Zoo.Length;
        int n = 0;

        for (int i = 0; i< Chang;  i++)
        {
            if(! Dic.ContainsValue(Zoo[i]) )
            {
                n++;
                Dic.Add(n, Zoo[i]);
            }
        }


            Console.WriteLine(n);
    }
}
        
       
全部评论

相关推荐

01-12 20:31
东北大学 Java
点赞 评论 收藏
分享
评论
1
1
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务