c#实现,统计一句英文句子中某个单词出现的次数.-查字典问答网
分类选择

来自李颜聪的问题

  c#实现,统计一句英文句子中某个单词出现的次数.

  c#实现,统计一句英文句子中某个单词出现的次数.

4回答
2020-05-16 17:07
我要回答
请先登录
阮亮中

  usingSystem;

  usingSystem.Collections.Generic;

  usingSystem.Linq;

  usingSystem.Text;

  usingSystem.Data.SqlClient;

  namespaceConsoleApplication1

  {

  classProgram

  {

  staticvoidMain(string[]args)

  {

  strings,s1,s2;

  intcount=0;

  Console.WriteLine("请输入你要查找的那个单词的句子:");

  stringstr=Console.ReadLine();

  Console.WriteLine("请输入你要查找的那个单词:");

  stringserchword=Console.ReadLine();

  intsbcount=serchword.Count();

  for(inti=0;i

2020-05-16 17:10:44
阮亮中

  你把题目说具体些,要在哪个控件上显示数据

2020-05-16 17:11:47
阮亮中

  上面是英文句子,而这里是字符串,到底是个英文句子(有空格的Lookattheball),还是随便写的,如dflj;thedfal;thesdjf这里的the的个数

2020-05-16 17:15:02
阮亮中

  哥们,不好意思,今天才看到,但是我发现你的还是有问题的,如果你输入的内容没有the,就会不对,如ddgga,改成如下:stringstr=textBox1.Text.ToLower();intm=0;for(inti=0;ii)m++;str=str.Substring(n);}label1.Text="the出现的次数="+m;下面是我做的,你可以参考下:intindexnumber=0;stringstr=textBox1.Text.ToLower();intcount=0;for(inti=0;i

2020-05-16 17:16:39

最新问答

推荐文章

猜你喜欢

附近的人在看

推荐阅读

拓展阅读

  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  •