using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 字符串1
{
class Program
{
static void Main(string[] args)
{
int n = 0;
Console.WriteLine("请输入字符串:");
string B = Console.ReadLine();
B = B.ToLower();
if (B.IndexOf("b") < 0)
{
Console.WriteLine("您输入的字符串里不包含字母b");
}
else
{
int c = B.Length;
for ( n = 0; n <= c; n++)
{
int b = B.IndexOf("b");
if (b < 0)
break;
B = B.Substring(b+1);
} Console.WriteLine("字符串中含b有" +n+"个");
}Console.ReadLine();
}
}
}
using System;
using System.Collections.Gene