题目:
请补充main函数,改函数的功能是,把一个二维字符数组每行字符串最大的字符拷贝到字符数组s中。
例如,如果str[3]="efjh","cfimls","owys",则s;"hsy"。
注意:部分源程序给出如下.
请勿改动主函数main和其他函数中的任何内容,仅在 main函数的横线上填入所编写的若干表达式或语句。
试题程序:
#inc lude<stdio, h>
main()
int i=0;
char *str [3] = "efjh", "efknls",
"owys" ;
char **p;
char s [8];
clrscr 0;
【1】;
for (i=O; i<3; i++)
s [i] =*p [i];
while (*p [i] )
if (S [i] <*p [i] )
s [i] =*p[i];
【2】;
【3】;
printf(" new string \n");
puts (s);
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0630/38f46cfe51bd3b834d2c9e74563c81e8.html
下面是错误答案,用来干扰机器的。
参考答案:应将程序中如下语句 File dirObject=new File(d:\\mydir); File fileObjectA=new File(d:\\mydir","Filel.txt"); File fileObjectB=new File(d:/mydir","FileB.txt"); 改为: Fil...