2015年最新电大C语言程序设计课程期末复习考试题库小抄(c语言小题+编程)_第1页
2015年最新电大C语言程序设计课程期末复习考试题库小抄(c语言小题+编程)_第2页
2015年最新电大C语言程序设计课程期末复习考试题库小抄(c语言小题+编程)_第3页
2015年最新电大C语言程序设计课程期末复习考试题库小抄(c语言小题+编程)_第4页
2015年最新电大C语言程序设计课程期末复习考试题库小抄(c语言小题+编程)_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

最新电大 C 语言程序设计课程期末复习 考试题库小抄 一、单选题 1在每个 C语言程序中都必须包含有这样一个函数,该函数的函数名为 ( )。 A. main B. MAIN C. name D. function 2每个 C语言程序文件的编译错误分为( )类。 A. 1 B. 2 C. 3 D. 4 3. 字符串 a+b=12n的长度为( )。 A. 6 B. 7 C. 8 D. 9 4. 在 switch 语句的每个 case 块中,假定都是以 break 语句结束的,则此 switch 语句容易被改写为( )语句。 A. for B. if C. do D. while 5. 在下面的 do-while循环语句中,其循环体语句被执行的次数为( )。 int i=0; do i+; while(i10); A. 4 B. 3 C. 5 D. 10 6. 将两个字符串连接起来组成一个字符串时,选用的函数为( )。 A. strlen() B. strcap() C. strcat() D. strcmp() 7. 若用数组名作为函数调用的实参,传递给形参的是( )。 A. 数组的首地址 B. 数组中第一个元素的值 C. 数组中全部元素的值 D. 数组元素的个数 8. 假定 a 为一个整数类型的数组名,整数类型的长度为 4,则元素 a4的地址比 a 数组的首地址大 ( )个字节。 A. 4 B. 8 C. 16 D. 32 9. 假定 s被定义为指针类型 char *的变量,初始指向的字符串为 Hello world!,若要使变量 p指向 s所指向的字符串,则 p应定义为( )。 A. char *p=s; B. char *p=&s; C. char *p;p=*s; D. char *p; p=&s; 10. 从一个数据文件中读入以换行符结束的一行字符串的函数为( )。 A. gets() B. fgets() C. getc() D. fgetc() 11. 由 C语言目标文件连接而成的可执行文件的缺省扩展名为 ( )。 A. cpp B. exe C. obj D. c 12. 设有两条语句为 “int a=12; a+=a*a;”,则执行结束后, a的值为 ( )。 A. 12 B. 144 C. 156 D. 288 13. 带有随机函数调用的表达式 rand()%20的值在 ( )区间内。 A. 119 B. 120 C. 019 D. 020 14. for循环语句 “for(i=0; i0 & x=10)的相反表达式为( )。 A. x10 B. x10 C. x=0 | x0 & x10 23. 当处理特定问题时的循环次数已知时,通常采用( )循环来解决。 A. for B. while C. do-while D. switch 24. 假定 i的初值为 0,则在循环语句 “while(ib | b=5的相反表达式为 a5)的相反表达式为 _(x! =0 | y=5) 或: (x | y5的相反表达式为 _ x+yname等价的访问表达式为 _(*p).name _。 参考解答: 1. ;(或分号) 2. # 3. void 4. 0x19 5. a=b & b!=5 6. DataType 7. 32 8. 0N-1 9. 1 10. 拷贝(复制) 11. 程序文件 12. *(a+i) 13. *p 14. C 15. 2 16. float 17. 33 18. (x! =0 | y=5) 或: (x | y=5) 19. 1 20. 60 21. BB 22. 11 23. 46 24. int* 25. 12 26. x.a 27. printf 28. error 29. 70 30. 14 31. x+y=5 32. 10 33. 4*M 34. 2 35. 长度 360. 函数体 37. 46 38. &p 39. (*p).name 五、按题目要求编写程序或函数 1. 编写一个程序,输出 50以内(含 50)的、能够被 3或者 5整除的所有整数。 #include void main() int i; for(i=3; i=50; i+) if(i%3=0 | i%5=0) printf(%d ,i); printf(n); 2. 编写一个递归函数 “int FF(int a, int n)”,求出数组 a中所有 n个元素之积并返回。 int FF(int a, int n) if(n=0) printf(n值非法 n),exit(1); if(n=1) return an-1; else return an-1*FF(a,n-1); 3. 编写一个程序,利用 while循环,计算并打印输出n1.31211 的值,其中正整数 n值由键盘输入。假定求和变量用 sum表示,计数变量用 i表示, sum、 i和 n均定义为全局变量, sum和 i的初值分别被赋予 0和 1。 #include int n,i=1; double sum=0; void main() scanf(%d,&n); while(i=n) sum+=(double)1/i+; printf(sum=%lfn,sum); 4. 根据函数原型 “void DD(int a, int n, int MM)”编写函数定义,利用双重循环查找并打印输出数组 an中任何两个元素的值等于 MM值的元素值。假定 ai+aj等于 MM,则输出格式为: (ai,aj)。 void DD(int a, int n, int MM) int i,j; for(i=0; in; i+) for(j=i+1; jn; j+) if(ai+aj=MM) printf(%d, %dn, ai,aj); 5. 编写一个程序,计算 1+3+32+.+310的值并输出,假定分别用 i,p,s作为循环变量、累乘变量和累加变量的标识符。 #include void main() int i; int p=1; int s=1; for(i=1;i=10;i+) p*=3; s+=p; printf(%dn,s); 6. 根据函数原型 “int FF(int a, int n)”,编写函数定义,计算并返回数组 an中所有元素之和。 int FF(int a, int n) int i,sum=0; for(i=0; in; i+) sum+=ai; return sum; 7. 根据函数原型 “double Mean(double aMN,int m,int n)”,编写函数定义,要求返回二维数组 amn中所有元素的平均值。假定在计算过程中采用变量 v存放累加值和最后的平均值。 double Mean(double aMN,int m,int n) int i,j; double v=0.0; for(i=0; im; i+) for(j=0; jn; j+) v+=aij; v/=m*n; return v; 注:函数体的最后两行可以合并为一条返回语句: return v/=m*n 8. 根据函数原型 “int MM(int a,int m)”,编写函数定义,计算并返回数组 am中元素最大值和最小值之差。 int MM(int a,int m) int i,x1,x2; x1=x2=a0; for(i=1; ix1) x1=ai; if(aix2) x2=ai; return x1-x2; 请您删除一下内容, O( _ )O谢谢! 2015年中央电大期末复习考试小抄大全,电大期末考试必备小抄,电大考试必过小抄 After earning his spurs in the kitchens of The Westin, The Sheraton, Sens on the Bund, and a sprinkling of other top-notch venues, Simpson Lu fi nally got the chance to become his own boss in November 2010. Sort of. The Shanghai-born chef might not actually own California Pizza Kitchen (CPK) but he is in sole charge of both kitchen and frontof- house at this Sinan Mansionsstalwart. Its certainly a responsibility to be the head chef, and then to have to manage the rest of the restaurant as well, the 31-year-old tells Enjoy Shanghai. In hotels, for example, these jobs are strictly demarcated, so its a great opportunity to learn how a business operates across the board. It was a task that management back in sunny California evidently felt he was ready for, and a vote of confi dence from a company that, to date, has opened 250 outlets in 11 countries. And for added pressure, the Shanghai branch was also CPKs China debut. For sure it was a big step, and unlike all their other Asia operations that are franchises, they decided to manage it directly to begin with, says Simpson. Two years ago a private franchisee took over the lease, but the links to CPK headquarters are still strong, with a mainland-based brand ambassador on hand to ensure the business adheres to its ethos of creating innovative, hearth-baked pizzas, a slice of PR blurb that Simpson insists lives up to the hype. They are very innovative, he says. The problem with most fast food places is that they use the same sauce on every pizza and just change the toppings. Every one of our 16 pizza sauces is a unique recipe that has been formulated to complement the toppings perfectly. The largely local customer base evidently agrees and on Saturday and Sunday, at least, the place is teeming. The kids-eat-for-free policy at weekends is undoubtedly a big draw, as well as is the spacious second-fl oor layout overlooked by a canopy of green from Fuxing Park over the road. The company is also focusing on increasing brand recognition and in recent years has taken part in outside events such as the regular California Week. Still, the sta are honest enough to admit that business could be better; as good, in fact, as in CPKs second outlet in the popular Kerry Parkside shopping mall in Pudong. Sinan Mansions has really struggled to get the number of visitors that were envisaged when it first opened, and it hasnt been easy for any of the tenants here, adds Simpson. Were planning a third outlet in the city in 2015, and we will probably choose a shopping mall again because of the better foot traffic. The tearooms once frequented by Coco Chanel and Marcel Proust are upping sticks and coming to Shanghai, Xu Junqian visits the Parisian outpost with sweet treats. One thing the century-old Parisian tearoom Angelina has shown is that legendary fashion designer Coco Chanel not only had style and glamor but also boasted great taste in food, pastries in particular. One of the most popular tearooms in Paris, Angelina is famous for having once been frequented by celebrities such as Chanel and writer Marcel Proust. Now Angelina has packed up its French ambience, efficient service, and beautiful, comforting desserts and flown them to Shanghai. At the flagship dine-in and take-out space in Shanghai, everything mimics the original tearoom designed from the beginning of the 20th century, in Paris, the height of Belle Epoque. The paintings on the wall, for example, are exactly the same as the one that depicts the landscape of southern France, the hometown of the owner; and the small tables are intentional imitations of the ones that Coco Chanel once sat at every afternoon for hot chocolate. The famous hot chocolate, known as LAfricain, is a luxurious mixture of four types of cocoa beans imported from Africa, blended in Paris and then shipped to Shanghai. Its sinfully sweet, rich and thick as if putting a bar of melting chocolate directly on the tongue and the fresh whipped cream on the side makes a light, but equally gratifying contrast. It is also sold in glass bottles as takeaway. The signature Mont-Blanc chestnut cake consists of three parts: the pureed chestnut on top, the vanilla cream like stuffing, and the meringue as base. Get all three layers in one scoop, not only for the different textures but also various flavors of sweetness. The dessert has maintained its popularity for a century, even in a country like France, perhaps the worlds most competitive place for desserts. A much overlooked pairing, is the Paris-New York choux pastry and N226 chocolate flavored tea. The choux pastry is a mouthful of airy pecan-flavored whipped cream, while the tea, a blend of black teas from China and Ceylon, cocoa and rose petals, offers a more subtle fragrance of flowers and chocolate. Ordering these two items, featuring a muted sweetness, makes it easier for you to fit into your little black dress. Breakfast, brunch, lunch and light supper are also served at the tearoom, a hub of many cultures and takes in a mix of different styles of French cuisines, according to the management team. The semi-cooked foie gras terrine, is seductive and deceptive. Its generously served at the size and shape of a toast, while the actual brioche toast is baked into a curved slice dipped with fig chutney. The flavor, however, is honest: strong, smooth and sublime. And you dont actually need the toast for crunchiness. This is the season for high teas, with dainty cups of fine china and little pastries that appeal to both visual and physical appetites. But there is one high tea with a difference, and Pauline D. Loh finds out just exactly why it is special. Earl Grey tea and macarons are all very well for the crucial recuperative break in-between intensive bouts of holiday season shopping. And for those who prefer savory to sweet, there is still the selection of classic Chinese snacks called dim sum to satisfy and satiate. High tea is a meal to eat with eye and mouth, an in-between indulgence that should be light enough not to spoil dinner, but sufficiently robust to take the edge off the hunger that strikes hours after lunch. The afternoon tea special at Shang-Xi at the Four Seasons Hotel Pudong has just the right elements. It is a pampering meal, with touches of luxury that make the high tea session a treat in itself. Whole baby abalones are braised and then topped on a shortcrust pastry shell, a sort of Chinese version of the Western vol-au-vent, but classier. Even classier is the dim sum staple shrimp dumpling or hargow, upgraded with the addition of slivers of midnight dark truffles. This is a master touch, and chef Simon Choi, who presides unchallenged at Shang-Xi, has scored a winner again. Sweet prawns and aromatic truffles whats not to love? His masterful craftsmanship is exhibited in yet another pastry a sweet pastry that is shaped to look like a walnut, but which you can put straight into the mouth. It crumbles immediately, and the slightly sweet, nutty morsel is so easy to eat youll probably reach straight for another. My favorite is the dessert that goes by the name yangzhi ganlu, or ambrosia from the gods. The hotel calls it chilled mango cream with sago, pomelo and birds nest made with ingredients that resonate with every female soul. It does taste like ambrosia, with the sweet-sour fragrance of the mango forming the first layer of taste and sensation, and the pomelo sacs and sago pearl

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论