四、程序設(shè)計(jì)題
請編寫函數(shù)proc( ),其功能是:將str所指字符串中下標(biāo)為偶數(shù)的字符刪除,串中剩余字符形成的新串放在t所指數(shù)組中。
例如,當(dāng)str所指字符串中的內(nèi)容為abcdefg,則在t所指數(shù)組中的內(nèi)容應(yīng)是bdf。
注意:部分源程序給出如下。
請勿改動main( )函數(shù)和其他函數(shù)中的任何內(nèi)容,僅在函數(shù)proc( )的花括號中填入所編寫的若干語句。
試題程序:
#include
#include
#include
#include
void proc(char*str,char t[])
{
}
void main( )
{
char str[100],t[100];
system("CLS");
printf("\nPlease enter string str:");
scanf("%S",str);
proc(str,t);
printf("\nThe result is:%s\n",t);
}
相關(guān)推薦:
2015年計(jì)算機(jī)二級C語言測試題及答案解析匯總
2015年計(jì)算機(jī)二級《MSOffice》精選選擇題匯總
2015計(jì)算機(jī)二級《C語言程序設(shè)計(jì)》無紙化操作題匯總