Console.WriteLine("请输入学生A喜欢的课程");
string ScoreA = Console.ReadLine();
Console.WriteLine("请输入学生B喜欢的课程");
string ScoreB = Console.ReadLine();
//ScoreA = ScoreA.ToLower();
//ScoreB = ScoreB.ToLower();
//if (ScoreA == ScoreB)
if (ScoreA.Equals(ScoreB, StringComparison.OrdinalIgnoreCase))
{
Console.WriteLine("YEAH");
}
else
{
Console.WriteLine("NO");
}
两种方法 |