实验8.2 指针与字符串.docx

实验8.2 指针与字符串 题目信息表 序号 题目名称 题目满分 题目得分 题目编号 1 找最大的字符串(调试示例error08_2) 2 找最长字符串 3 使用函数删除字符串中的字符 4 使用函数实现字符串复制 5 判断回文字符串 6 分类统计字符个数 1 找最大的字符串(调试示例error08_2) #include stdio.h #include string.h int main(void) { char str[80], max[80]; int i; scanf(%s, str); strcpy(max,str); for(i=1;i5;i ){ scanf(%s,str); if(strcmp(max,str)0) strcpy(max,str); } /*-----程序填空,不要改变与输入输出有关的语句。 输入5个字符串,输出其中最大的字符串。 输入输出示例:括号内为说明 输入: peach pear melon orange berry 输出: Max is: pear ----*/ printf(Max is: %s\n, max); return 0; } 2 找最长字符串 #include stdio.h #include st

文档评论(0)

1亿VIP精品文档

相关文档