?? prog19.c
字號(hào):
/*
編寫(xiě)函數(shù)fun,該函數(shù)的功能是:從字符串中刪除指定的字符。同一字母的大、小寫(xiě)按不同字符處理。
例如:若程序執(zhí)行時(shí)輸入字符串為: turbo c and borland c++ 從鍵盤(pán)上輸入字符n,則輸出后變?yōu)椋簍urbo ca ad borald c++
如果輸入的字符在字符串中不存在,則字符串照原樣輸出。
注意:部分源程序給出如下。
請(qǐng)勿改動(dòng)主函數(shù)main和其他函數(shù)中的任何內(nèi)容,僅在函數(shù)fun的花括號(hào)中填入所編寫(xiě)的若干語(yǔ)句。
*/
#include <stdio.h>
#include <conio.h>
int fun(char s[],int c)
{
}
main()
{ static char str[]="turbo c and borland c++";
char ch;
clrscr();
printf(" :%s\n",str);
printf(" :");
scanf("%c",&ch);
fun(str,ch);
printf("str[]=%s\n",str);
}
/*
答案:
int i,k=0;
for(i=0;s[i];i++)
if(s[i]!=c) s[k++]=s[i];
s[k]='\0';
*/
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -