原文:输入一段字符(只含有空格和字母,保证开头不为空格),里面有若干个字符串,求这些字符串的长度和,并输出最长字符串内容,如果有多个输出最先出现的那个字符串。以stop作为最后输入的字符串。

include lt stdio.h gt include lt string.h gt main int i,j ,m,count,max char a while gets a count max if strcmp a, stop break for i strlen a i gt i if a i amp amp i j count else if a i i if i j count ...

2020-03-28 15:42 0 2164 推荐指数:

查看详情

个字符串出现同样且长度最长字符串

题目:输入一行字符串。找出当中出现的同样且长度最长字符串输出它及其首字符的位置。 比如:“yyabcdabjcabceg",输出结果应该为abc 和3. #include<iostream> #include< ...

Thu Jul 20 02:35:00 CST 2017 0 1322
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM