任何一个C程序都由()和若干个被调用的其它函数组成。
参考答案:一个主函数
【说明】 下面的程序按照以下规则输出给定名词的复数形式。 a.若名词以“y”结尾,则删除y并添加“ies”; b.若名词以“s”、“ch”或“sh”结尾,则添加“es”; c.其他所有情况,直接添加“s”。【C程序】 #include <stdio.h> #include <string.h> char*plural(char *word) { int n; char *pstr; n=strlen(word); /*求给定单词的长度*/ pstr=(char*)malloc(n+3);/*申请给定单词的复数形式存储空间*/ if (!pstr||n<2)return NULL; strcpy(pstr,word); /*复制给定单词*/ if ( (1) ) {pstr[n-1]=’i’;pstr[n] =’e’;pstr[n+1]=’s’; (2) ; } elseif(pstr[n-1]==’s’| |pstr[n-1]==’h’&&( (3) )){ pstr[n]=’e’;pstr[n+1]=’s’;pstr[n+2]=’\0’;}else { pstr[n]=’s’;pstr[n+1]=’\0’;) (4) ; }main() { int i; char *ps;char wc[9][10]={"chair","dairy","boss","circus","fly","dog","church","clue","dish");for(i = 0;i<9; i++) { ps= (5) ; printf("%s: %s\n",wc[i],ps); /*输出单词及其复数形式*/ free(ps); /*释放空间*/}system("pause"); }
( )起动方式不适合作为笼型转子异步电动机起动方式。
A.全压 B.电抗器减压C.转子串电阻 D.Y-△降压