java中的字符串和键盘输入

发布于 2024-10-01 11:25:53 字数 195 浏览 1 评论 0原文

我需要编写一个 Java 程序,它从键盘读取一个字符串,然后报告字母表中的每个字母在该字符串中出现的次数(忽略大小写)。它还应该报告字符串中包含多少个非字母。

但我什至不知道从哪里开始,

如果有人愿意为我编写这个程序和/或引导我一步步完成它,我将非常感激。哎呀,如果有人只是写了这个程序,我愿意付钱(而且我可以 - 给我发电子邮件了解详细信息)

I need to write a Java program which reads in a string from the keyboard and then reports how many times each letter of the alphabet occurs within that string (ignoring case). It should also report how many non-letters are included in the string.

but I don't even know where to begin

if someone is willing to write this program for me and/or take me through it step by step I would be very grateful. Heck if someone just wrote the program for be I would be willing to pay (and I can- email me for details)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

┊风居住的梦幻卍 2024-10-08 11:25:53

Stack Overflow 不是一个你应该要求人们为你做作业的地方,还有其他网站可以做到这一点。

我可以回答你的问题,就像这里的许多其他人一样,但如果你要学习如何编程,你最好自己做作业。

如果您不知道从哪里开始,请查看这些网站:

小写:
download.oracle.com/javase/1.3/docs/api/java/lang/String.html#toLowerCase(java.util.Locale)

遍历字符:
download.oracle.com/javase/1.3/docs/api/java/text/StringCharacterIterator.html

http://www.exampledepot.com/egs/java.text/StrIter.html

Stack overflow is not a place where you should ask people to do your homework for you, there are other websites for that.

I could answer your question, as many other people here could, but if you're ever going to learn how to program you'd better do your homework yourself.

If you can't figure out where to begin, check out these websites:

lower casing:
download.oracle.com/javase/1.3/docs/api/java/lang/String.html#toLowerCase(java.util.Locale)

going over characters:
download.oracle.com/javase/1.3/docs/api/java/text/StringCharacterIterator.html

http://www.exampledepot.com/egs/java.text/StrIter.html

骑趴 2024-10-08 11:25:53
  • 从 System.in 读取输入
  • 对输入字符串的每个字符进行循环
  • 将字符计数放入地图
  • 打印报告

就这样。

  • Read input from System.in
  • Loop on each character of the input string
  • Put character count in a Map
  • Print report

There you go.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文