函数题:找最大字符串
本题要求从键盘上输入多个字符串(约定每个串不超过20个字符且没有空格,最多10个字符串),用"\*\*\*\*\*"作为输入结束的标记("\*\*\*\*\*"不作为有效的字符串)。再从所输入的若干字符串中,找出一个最大的串,并输出该串。
如果没有合法字符串,则输出“NO WORD”。 请完成主函数剩余部分以及自定义函数的编写。
### 函数接口定义:
c++
int Input(char*pstr[], char (*s)[21]);
void Find_max(char*pstr[], int count, int*Max);
### 裁判测试程序样例:
c++
#include <stdio.h>
#include <string.h>
int main(void)
{
char *pStr[10], str[10][21];
int Count=0, max;
/* 请在这里填写答案 */
### 输入样例:
in
aabb xdsfkjs8 z1 w1589sa z0351ff
### 输出样例:
out
max = z1
答案:若无答案欢迎评论
如果没有合法字符串,则输出“NO WORD”。 请完成主函数剩余部分以及自定义函数的编写。
### 函数接口定义:
c++
int Input(char*pstr[], char (*s)[21]);
void Find_max(char*pstr[], int count, int*Max);
### 裁判测试程序样例:
c++
#include <stdio.h>
#include <string.h>
int main(void)
{
char *pStr[10], str[10][21];
int Count=0, max;
/* 请在这里填写答案 */
### 输入样例:
in
aabb xdsfkjs8 z1 w1589sa z0351ff
### 输出样例:
out
max = z1
答案:若无答案欢迎评论