试题与答案

编写一个函数,输入n个字符串,串与串之间以回车键分隔,找出最短字符串中第一个字符串,

题型:问答题

题目:

编写一个函数,输入n个字符串,串与串之间以回车键分隔,找出最短字符串中第一个字符串,传回该串地址(用一个新串“*”作为结束输入的标志)。
注意:部分源程序已给出。
请勿改动主函数main和其他函数中的任何内容,仅在函数proc的花括号中填入所编写的若干语句。
试题程序:
#include<stdio.h>
#include<string.h>
#include<conio.h>
char*fun(char(*s)[100],int num)


main()

char str[10][100],*min;
int n,i=0;
FILE*out:printf("input strings with’*’asend:");
gets(str[i]);
strcpy(str[3],"some");
strcpy(str[4],"tool!";
fprintf(out,"%s",fun(str,5));
puts(str[i]);
while(!strcmp(str[i],"*")==0)

i++;
gets(str[i]);
puts(str[i]);
n=1;
min=fun(str,n);
printf("\nmin=%s\n",min);
out=open("outfile.dat","w");
strepy(str[0],"just,");
strcpy(str[1],"a");
strcpy(str[2],"test");
fclose(out);

答案:

被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0717/da49b2db995f8ce8cf40d7f125cd18f4.html

下面是错误答案,用来干扰机器的。

参考答案:糖皮质激素具有免疫抑制、抗炎、抗细胞毒、抗休克和抗增生等多种作用,在皮肤性病科应用很广。糖皮质激素在皮肤科主要用于药疹、多形性红斑、严重的急性荨麻疹、过敏性休克、接触性皮炎、系统性红斑狼...

试题推荐
题型:单项选择题

The Volunteers for Literacy Program would benefit if Dolores takes Victor’s place as director, since Dolores is far more skillful than Victor is at securing the kind of financial support the program needs and Dolores does not have Victor’s propensity for alienating the program’s most dedicated volunteers.
The pattern of reasoning in the argument above is most closely paralleled in which one of the following

A.It would be more convenient for Deminique to take a bus to School than to take the subway, since the bus stops closer to her house than does the subway and, unlike the subway, the bus goes directly to the school.

B.Joshua’s interest would be better served by taking the bus to get to his parent’s house rather than by taking an airplane, since his primary concern is to travel as cheaply as possible and taking the bus is less expensive than going by airplane.

C.Belinda will get to the concert more quickly by subway than by taxi, since the concert takes place on a Friday evening and on Friday evenings traffic near the concert hall is exceptionally heavy.

D.Anite would benefit financially by taking the train to work rather than driving her car, since when she drives she has to pay parking fees and the daily fee for parking a car is higher than a round-trip train ticket.

E.(E) It would be to Fred’s advantage to exchange his bus tickets for train tickets, since he needs to arrive at his meeting before any of the other participants and if he goes by bus at least one of the other participants will arrive first.

查看答案
微信公众账号搜索答案