数の階乗


Step 1 : Visual Studioを開き、コンソールアプリケーションを選択します.
ステップ2 :文字列の文字の出現を見つけるプログラムを書く
システムの使用
システムの使用コレクション.ジェネリック
システムの使用LINQ
システムの使用テキスト;
システムの使用スレッドタスク;
名前空間の属性
{ }
クラスプログラム
{ }
static void main ( string [] args )
{ }
string文=文字列.空
        Console.WriteLine("Enter a string to check occurrence of a character numbers");

        Statement = Console.ReadLine();
        Statement = Statement.ToLower();

        if (Statement.Length > 0)
        {
            while (Statement.Length > 0)
            {
                int CountCharacter = 0;
                Console.Write("Number of Occurance of '" + Statement[0] + "': ");

                //Checking the Character occurrence in the string entered by the user
                for (int i = 0; i < Statement.Length; i++)
                {
                    if (Statement[0] == Statement[i])
                    {
                        CountCharacter++;
                    }
                }

                //Count of each character
                Console.Write(CountCharacter + "\n");

                //Removing that character from the string
                Statement = Statement.Replace(Statement[0].ToString(), string.Empty);
            }
        }
        Console.ReadLine();
    }
}

ステップ3 :アプリケーションを実行するとコンソールが開きます.
ステップ4 :文字列を入力して“Enter”キーを押して出力を参照してください.