c# 求提供思路,我str1“i want to eat an apple” str2"i want eat apple
来源:学生作业帮 编辑:大师作文网作业帮 分类:英语作业 时间:2024/09/22 11:37:14
c# 求提供思路,我str1“i want to eat an apple” str2"i want eat apple"用什么方法可以识别出str2少了
to 和an两个单词
to 和an两个单词
string str1="i want to eat an apple";
string str2="i want eat apple";
Console.WriteLine(str1.Length);
Console.Write(str2.Length);
Console.ReadKey();
第一个长度是22
第二个是16.
str2不就少了吗?
再问: 谢谢,那我怎么知道少了什么呢。。。
再答: string[] aa; string[] bb; string str1="i want to eat an apple"; string str2="i want eat apple"; aa = str1.Split(' '); bb = str2.Split(' '); int count=0; foreach(string c in aa) { count = 0; for (int i = 0; i < bb.Length; i++) { if (c != bb[i]) { count++; } if (count == bb.Length) { Console.Write(c+' '); } } } Console.ReadKey(); 已经把to和an两个缺失的单词在控制台输出了。你拿去用吧。
string str2="i want eat apple";
Console.WriteLine(str1.Length);
Console.Write(str2.Length);
Console.ReadKey();
第一个长度是22
第二个是16.
str2不就少了吗?
再问: 谢谢,那我怎么知道少了什么呢。。。
再答: string[] aa; string[] bb; string str1="i want to eat an apple"; string str2="i want eat apple"; aa = str1.Split(' '); bb = str2.Split(' '); int count=0; foreach(string c in aa) { count = 0; for (int i = 0; i < bb.Length; i++) { if (c != bb[i]) { count++; } if (count == bb.Length) { Console.Write(c+' '); } } } Console.ReadKey(); 已经把to和an两个缺失的单词在控制台输出了。你拿去用吧。
c# 求提供思路,我str1“i want to eat an apple” str2"i want eat apple
I want to eat an apple .谓语是want to eat吗
I want to eat an apple/apples/apple那个错了?为什么?
I eat an apple,but I want a____ one.
I want to eat an apple,but my hands are dirty.I want my hand
l want to eat an apple
Do you want to eat an apple?
I want to eat an apple but I have no idea how to
I want to eat ( A meat.B apple
I want to eat an apple and a orange.那两个是宾语?an apple 和 a oran
I want to eat an apple.这句主谓宾是那些
I want to eat an apple and a orange.那两个是宾语?