JAVA语言:编写一个程序,统计出下列段落中单词的个数.
来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/04/30 00:15:36
JAVA语言:编写一个程序,统计出下列段落中单词的个数.
Discover Agile Development Conference & Better Software Conference West—the premier collocated conferences for software professionals.These two events bring you the most up-to-date information,tools,and trends regarding agile,project management,people and teams,software testing and QA,software requirements,process improvement,metrics,design,and architecture.Join industry experts and peers for a week jam-packed with learning sessions that will help you make a powerful impact in your job role and for your company.
Discover Agile Development Conference & Better Software Conference West—the premier collocated conferences for software professionals.These two events bring you the most up-to-date information,tools,and trends regarding agile,project management,people and teams,software testing and QA,software requirements,process improvement,metrics,design,and architecture.Join industry experts and peers for a week jam-packed with learning sessions that will help you make a powerful impact in your job role and for your company.
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Test{
public static void main(String[] args){
String text="Discover Agile Development Conference & Better Software Conference West—the premier collocated conferences for software professionals.These two events bring you the most up-to-date information,tools,and trends regarding agile,project management,people and teams,software testing and QA,software requirements,process improvement,metrics,design,and architecture.Join industry experts and peers for a week jam-packed with learning sessions that will help you make a powerful impact in your job role and for your company.";
Matcher m=Pattern.compile("\\w+").matcher(text);
int c=0;
while(m.find())
System.out.print((++c)+":"+m.group()+"\t");
System.out.println("\n单词数:"+c);
}
}1:Discover 2:Agile 3:Development 4:Conference 5:Better 6:Software 7:Conference 8:West 9:the 10:premier 11:collocated 12:conferences 13:for 14:software 15:professionals 16:These 17:two 18:events 19:bring 20:you 21:the 22:most 23:up 24:to 25:date 26:information 27:tools 28:and 29:trends 30:regarding 31:agile 32:project 33:management 34:people 35:and 36:teams 37:software 38:testing 39:and 40:QA 41:software 42:requirements 43:process 44:improvement 45:metrics 46:design 47:and 48:architecture 49:Join 50:industry 51:experts 52:and 53:peers 54:for 55:a 56:week 57:jam 58:packed 59:with 60:learning 61:sessions 62:that 63:will 64:help 65:you 66:make 67:a 68:powerful 69:impact 70:in 71:your 72:job 73:role 74:and 75:for 76:your 77:company
单词数:77
import java.util.regex.Pattern;
public class Test{
public static void main(String[] args){
String text="Discover Agile Development Conference & Better Software Conference West—the premier collocated conferences for software professionals.These two events bring you the most up-to-date information,tools,and trends regarding agile,project management,people and teams,software testing and QA,software requirements,process improvement,metrics,design,and architecture.Join industry experts and peers for a week jam-packed with learning sessions that will help you make a powerful impact in your job role and for your company.";
Matcher m=Pattern.compile("\\w+").matcher(text);
int c=0;
while(m.find())
System.out.print((++c)+":"+m.group()+"\t");
System.out.println("\n单词数:"+c);
}
}1:Discover 2:Agile 3:Development 4:Conference 5:Better 6:Software 7:Conference 8:West 9:the 10:premier 11:collocated 12:conferences 13:for 14:software 15:professionals 16:These 17:two 18:events 19:bring 20:you 21:the 22:most 23:up 24:to 25:date 26:information 27:tools 28:and 29:trends 30:regarding 31:agile 32:project 33:management 34:people 35:and 36:teams 37:software 38:testing 39:and 40:QA 41:software 42:requirements 43:process 44:improvement 45:metrics 46:design 47:and 48:architecture 49:Join 50:industry 51:experts 52:and 53:peers 54:for 55:a 56:week 57:jam 58:packed 59:with 60:learning 61:sessions 62:that 63:will 64:help 65:you 66:make 67:a 68:powerful 69:impact 70:in 71:your 72:job 73:role 74:and 75:for 76:your 77:company
单词数:77
JAVA语言:编写一个程序,统计出下列段落中单词的个数.
用java 编写一个程序,接受用户输入的一段英文文字,统计出其中的字符个数、单词个数和句子的个数.
请使用java语言编写一段程序,统计这段文字中单词的个数,并输出其中由四个字母组成的单词
用C语言编写程序,对字符数组中存放的任意英语文章,统计其单词个数.
用JAVA编写一个程序能统计每个长度的单词的数量!
编写一个C语言程序,关于“统计一条英文句子中字母的个数,在主程序中实现输入输出”
c语言编写一个程序,在一维数组里输入一句英文,统计该句子里出现的单词个数
Java 统计一句话中相同单词的个数
用C语言编写一程序,统计从键盘输入的任意自然数中偶数的个数并求其和
C语言补全程序问题统计一个字符串中单词的个数,单词以一个空格为间隔.#includemain(){char *s="yo
编写java程序,输入若干个正数,计算它们的平均值并统计比平均值大的实数的个数.
急用:编写C程序,读取一个文本文件,统计其中的英文字母与数字字符的个数,全部字符个数与单词个数.