题目
第1题
A.his babysitter
B.Jenny
C.his brother
D.his mom
第2题
已知文件IN21.DAT中存有100个产品销售记录,每个产品销售记录由产品代码dm(字符型4位)、产品名称mc(字符型10位)、单价dj(整型)、数量s1(整型)、金额je(长整型)几部分组成。其中:金额 =单价×数量。函数ReadDat()的功能是读取这100个销售记录并存入结构数组sell中。请编制函数SortDat(),其功能要求:按产品名称从大到小进行排列,若产品名称相同,则按金额从小到大进行排列,最终排列结果仍存入结构数组sell中,最后调用函数WriteDat()把结果输出到文件OUT21.DAT中。
注意:部分源程序已给出。
请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。
试题程序:
include 〈stdio.h>
include 〈mem.h>
include 〈string.h>
include 〈conio. h>
include 〈stdlib.h>
define MAX 100
typedef struct
{
char dm[5]; /* 产品代码 */
char mc[11]; /* 产品名称 */
int dj; /* 单价 */
int si; /* 数量 */
long je; /* 金额 */
} PRO;
PRO sell [MAX];
void ReadDat ();
void WriteDat();
void SortDat()
{
}
main ()
{
memset(sell, 0, sizeof(sell));
ReadDat ();
SortDat ();
WriteDat ();
}
void ReadDat ()
{
FILE *fp;
char str[80], ch[11];
int i;
fp = fopen("IN21.DAT", "r");
for(i=0; i〈100; i++)
{
fgets(str, 80, fp);
memcpy(sell[i].dm, str, 4);
memcpy (sell [i] .mc, str + 4, 10);
memcpy(ch, str+ 14, 4);
ch[4] = 0;
sell[i] .dj = atoi(ch);
memcpy(ch, str +18, 5);
ch[5] = 0;
sell[i].sl = atoi(ch);
sell[i].je = (long) sell[i].dj * sell[i] .sl;
}
fclose (fp);
}
void WriteDat()
{
FILE *fp;
int i;
fp = fopen("OUT21.DAT", "w");
for(i = 0; i 〈 100; i++)
{
fprintf(fp, "%s %s %4d %5d %101d\n", sell[i].dm, sell[i].mc,
sell[i].dj, sell[i].sl, sell[i].je);
}
fclose (fp);
}
第3题
已知文件IN16.DAT中存有100个产品销售记录,每个产品销售记录由产品代码dm(字符型4位)、产品名称mc(字符型10位)、单价dj(整型)、数量sl(整型)、金额je(长整型)几部分组成。其中:金额=单价×数量。函数ReadDat()的功能是读取这100个销售记录并存入结构数组sell中。请编制函数 SortDat(),其功能要求:按产品名称从大到小进行排列,若产品名称相同,则按金额从大到小进行排列,最终排列结果仍存入结构数组sell中,最后调用函数WriteDat()把结果输出到文件OUT16.DAT中。
注意:部分源程序已给出。
请勿改动主函数main()、读函数ReadDat()和写函数WriteDat()的内容。
试题程序:
include〈stdio.h>
include〈mem.h>
include〈string.h>
include〈conio.h>
include〈stdlib. h>
define MAX 100
typedef struct
{
char dm[5]; /* 产品代码 */
char mc [11]; /* 产品名称 */
int dj; /* 单价 */
int sl; /* 数量 */
long je; /* 金额 */
} PRO;
PRO sell [MAX];
void ReadDat ();
void WriteDat ();
void SortDat ()
{
}
main ()
{
memset(sell, 0, sizeof(sell));
ReadDat ();
SertDat ();
WriteDat ();
}
veld ReadDat ()
{
FILE *fp;
char str[80] , ch[ill;
int i;
fp = fopen("IN16.DAT", "r");
for(i=0; i〈100; i++)
{
fgets(str, 80, fp);
memcpy(sell[i] .dm, str, 4);
memcpy(sell[i].mc, str + 4, 10);
memcpy(ch, str + 14, 4);
ch[4] = 0;
sell[i].dj = atoi(ch);
memcpy(ch, str + 18, 5);
ch[5] = 0;
sell[i].sl = atoi(ch);
sell[i].je = (long)sell[i].dj * sell[i].sl;
}
fclose (fp);
}
void WriteDat()
{
FILE *fp;
int i;
fp = fopen("OUT16.DAT", "w");
for(i = 0; i〈 100; i++)
{
fprintf(fp, "%s %s %4d %5d %101dkn", sell[i] .dm, sell[i] .mc,
sell[i].dj, sell[i].sl, sell[i].je);
}
fclose(fp);
}
第4题
A.DJ
B.Chowder
C.Jenny
D.DJ's Mom
第6题
A.The Monster House
B.Prince of Egypt
C.Beauty and Beast
D.Charlotte's Web
第10题
Mr. Musk is a guy who gets things done. The founder of two “moonshot” tech companies, Tesla Motors and SpaceX, is bringing electric vehicles to mass market and 26 humans to live on other planets. Lest this strike the amateur techie—not that readers of The Independent would ever count among them—as so much hot air, you can be reassured that the near $13bn (£8.8bn) fortune this entrepreneur has 27 comes from practical achievements rather than hypothetical ones.
A lot of clever people are 28 about artificial intelligence, fearing that robots will one day become so 29 they’ll murder all of us. These fears are mostly 30 : as with hysteria about genetic modification, we humans are generally wise enough to manage these problems with alacrity and care.
And just think of how wonderful it would be if you had a live-in robot. It could — 31 — be like having a babysitter and masseuse rolled into one — or, if that required 32 intelligence beyond the ken of Mr. Musk’s imagined machine, at least some one to chop the carrots, wash the car and mow the lawn. Once purchased and trained, this would allow the 33 user to save money and time, freeing up 34 space in our busy lives to, for instance, read The Independent.
That is why we welcome Mr. Musk’s latest 35 , and wish him well. As long as robots add to the sum of human happiness, reduce suffering or cumbersome activity, and create time to read world-class journalism, The Independent will be their fans. Especially since journalism is one job robots will never do.
A) amassed
B) casual
C) emotional
D) enabling
E) eventually
F) exaggerated
G) extravagant
H) generously
I) misleading
J) precious
K) reward
L) smart
M) sphere
N) terrified
O) venture
为了保护您的账号安全,请在“赏学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!