问题 填空题

下列给定程序中函数fun()的功能是:计算n!。例如,给 n输入5,则输出120.000000。
请改正程序中的错误,使它能得出正确的结果。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include <stdio.h>
#include <conio.h>
double fun (int n)
double result=l.0;
/*************found**************/
if n==0
return 1.0;
while (n>l&&n<170)
/*************found**************/
result *=n--
return result;

main ( )
int n;
printf ("Input N: ");
scanf ( "%d" &n);
printf ("\n\n%d!=%lf\n\n",n, fun(n));

答案

参考答案:错误:if n==0 正确:if(n==0)
(2)错误:result*=n-- 正确:result*=n--;

解析: 在做这道题之前,我们首先应该明白一个数学上的概念,一般判卷人员先要执行程序,如果结果正确,得满分,否则错一个扣分,再错再扣,本题考查5! 即5!=5×4×3×2×1=120,要求输出double型结果。

填空题

Third-generation mobile phones, known as 3G, are the next big step for the telecom industry. Data speed in 3G networks is much quicker than that in present technology. This means users can have high-speed Internet access and enjoy video and CD-quality music on their phones.

"Mobile data is not a dream; it’s not an option but a requirement," said Len Lauer, head of a US communications company, Sprint PCS, at a 3G conference in Bangkok earlier this month.

With 3G, you can forget about text messages telling you yesterday’s news; a 3G phone can receive video news programs, updated four times a day. Internet access will also be much quicker, making it easier to surf the Web on your phone than on your computer at home.

Don’t worry about getting lost. 3G phones offer map services so you can find a new restaurant just by pressing a few keys on your handset.

However, the most impressive part of 3G technology is video calling. With live two-way video communication, you can have face-to-face talks with friends and family on your mobile phone.

Many European countries have already launched the service. In May 2000 the US Government issued five license to run 3G wireless services, while the first 3G phones arrived in Italy in March this year.

International telecom companies can’t wait to sell 3G in China, the world’s largest mobile telecommunications market. But they will have to be patient. At the moment, China is busy testing its 3G-based technologies, networks and services. This will be followed by a trial period before the phones can finally hit the shops.

"We need to create a pool of 3G customers before the large-scale commercial launch of the service," said Fan Yunjun, marketing manager for Beijing Mobile. "We expect that the 3G licenses will be issued late next year.

Third-generation mobile phones (3G mobile phones)
(1)
  • a. Data speed: (2) than present technology
  • b. Video and (3) music
  • c. Video news programs: (4) four times a day
  • d. Internet access: quicker and (5)
Impressive

functions

a. Offer (6) services, helping you find your wayb. Provide two-way video (7)
3G phones in Chinaa. China is busy (8) its 3G-based technologies, networks and services.b. 3G phones should go through a (9) period before being put into market.c. 3G phones are expected to be seen (10) next year.

第(5)空应填()

多项选择题