36、编写函数fun,函数的功能是: 从s所指的字符串中删除给定的字符。同一字母的大、小写按不同字符处理。
若程序执行时输入字符串为: turbo c and borland c++
从键盘上输入字符:n, 则输出后变为: turbo c ad borlad c++
如果输入的字符在字符串中不存在, 则字符串照原样输出。
注意: 部分源程序在文件PROG1.C中。
请勿改动主函数main和其它函数中的任何内容, 仅在函数fun的花括号中填入你编写的若干语句。
#include #include void fun(char s[],char c)
{ }
main()
{
void
static char str[]="turbo c and borland c++";
char ch;
printf("原始字符串:%s\n", str);
printf("输入一个字符:");
scanf("%c",&ch);
fun(str,ch);
printf("str[]=%s\n",str);
}
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|