请编写函数proc(),其功能是:将str所指字符串中下标为偶数的字符删除,串中剩余字符形成的新串放在t所指数组中。
例如,当str所指字符串中的内容为abcdefg,则在t所指数组中的内容应是bdf。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的花括号中填入所编写的若干语句。
试题程序:
请编写函数proc(),其功能是:将str所指字符串中下标为偶数的字符删除,串中剩余字符形成的新串放在t所指数组中。
例如,当str所指字符串中的内容为abcdefg,则在t所指数组中的内容应是bdf。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的花括号中填入所编写的若干语句。
试题程序:
例如,若字符串中的内容为****a*bc*def*g** **,删除后,字符串中的内容则应当是a*bc*def*g** **。
注意:部分源程序给出如下。
请勿改动main函数和其他函数中的任何内容,仅在函数proc的花括号中填入所编写的若干语句。
试题程序:
include<stdio.h=:{>
include<conio.h>
woid proc(char*st r)
{
}
void main
char str[81];
printf("Enter a string:\n");
gets(str);
proc(str):
printf("The string after deleted:\n");
puts(str);}
请编写函数proc,该函数的功能是:将放在字符串数组中的M个字符串(每串的长度不超过N),按顺序合并组成一个新的字符串。 例如,若字符串数组中的M个字符串为: ABCD BCDEFG CDEFGHI 则合并后的字符串内容应该是ABCDBCDEFGCDEF—GHl。 注意:部分源程序给出如下。 请勿改动main函数和其他函数中的任何内容,仅在函数proc的花括号中填人所编写的若干语句。 试题程序: include<stdio.h> include<conio.h> define M 3 define N 20 void proc(char arr[M][N],char*b) {
} void main { char str[M][N]={"ABCD","BCDEFG"," CDEFGHI"},i; char arr[100]={" "); printf("The string:\n"); for(i=0;i<M;i++) puts(str[i]); printf("\n"); proc(str,arr); printf("The A string:\n"); printf("%s",arr); printf("\n\n"); }
数组str全由大小写字母字符组成。请补充函数proc(),该函数的功能是:把str中的字母转换成紧接着的下一个字母,如果原来的字母为&39;b&39;或&39;b&39;,则相应地转换成&39;c&39;或&39;C &39;,结果仍保存在原数组中。
例如,输入“String”,则输出“Tusjoh”。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
请补充函数proc(),该函数的功能是:把字符串str中的字符按字符的ASCⅡ码升序排列,处理后的字符串仍然保存在原串中,字符串及其长度作为函数参数传人。
例如,如果输入“9fedcba”,则输出为“abcdefg”。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
请补充函数proc(),该函数的功能是:把从主函数中输入的字符串str2接在字符串str1的后面。
例如,str1=”I am a”,str2=”student”,结果输出:I am a student。
注意:部分源程序给出如下。
请勿改动main()函数和其他函数中的任何内容,仅在函数proc()的横线上填入所编写的若干表达式或语句。
试题程序:
例如,str="abc3de987f9621",结果为:3987621。
注意:部分源程序给出如下。
请勿改动main函数和其他函数中的任何内容,仅在函数proc的横线上填入所编写的若干表达式或语句。
试题程序:
include<stdio.h>
define M 80
int bb[M];
int proc(char str[],int bb[],int num)
{
int i,n=0;
for(i=0;i<num;i++)
{
if(【1】)
{
bb[n]=【2】:
n++:
}
}
return 【3】 ;
}
void main
{
char str[M];
int mum=0,n,i;
printf("Enter a strin9:\n");
gets(str);
while(str[num])
num++:
n=proc(str,bb,num);
printf("\nbb=");
for(i=0;i<n;i++)
printf("%d",bb[i]);
}
请编一个函数fun(oh lr*str),该函数的功能是把字符串中的内容逆置。 例如,字符串中原有的字符串为asdf9,则调用该函数后,串中的内容为9fdsa。 请勿改动main函数和其他函数中的任何内容,仅在函数proc的花括号中填人所编写的若干语句。 试题程序: include<string.h> include<conio.h> include<stdio.h> define N 100 void fun(char * str) { } void main { char a[N]; FILE*out: printf("Enter a string:"); gets(a); printf("The origir al string is:"); puts(a); fun(a): printf("The string after modified:"); puts(a); strcpy(a,"Welcome!"); fun(a); ut=fopen("outfile.dat","w"); fprintf(out,"%s".a); fclose(out); }
为了保护您的账号安全,请在“简答题”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!