一、求最大篮球的单词数

using System;
using System.Diagnostics.CodeAnalysis;
namespace Consoleapp1007homework
{
class program
{
static int getCount(int[] count)
{
int[] newC = new int[count.Length];
for (int i = 0; i < count.Length; i++)
{
if (count[i] == 0)
{
return 0;
}
else if (i == 0 || i == 1 || i == 2)
{
newC[i] = count[i] / 2;
}
else
{
newC[i] = count[i];
}
}
int min = newC.Min();
return min;
}
static void Main(string[] args)
{
Console.WriteLine("text=");
char[] text = Console.ReadLine().ToCharArray();
char[] usenum = { 'b', 'a', 'l', 's', 'k', 'e', 't', };
int[] count = new int[usenum.Length];
for (int i = 0; i < text.Length; i++)
{
for (int j = 0; j < usenum.Length; j++)
{
if (text[i] == usenum[j])
{
count[j] += 1;
}
}
}
Console.WriteLine(getCount(count));
}
}
}
