110,555
社区成员
发帖
与我相关
我的任务
分享
string str = "111010101010101010101011010101010111";
int x = str.Split('1').Length;
bool IsDelete = false;
if (x >= 6)
IsDelete = true;
int i = 0;
string str = "101010101010101010";
foreach(char c in str)
{
if(c.Equals('1'))
i ++;
}
//查看有多少个1
Console.WriteLine("共有" + i + "个1");