电大1253+C语言程序设计A(7月)小抄参考

上传人:仙*** 文档编号:29242745 上传时间:2021-10-06 格式:DOC 页数:9 大小:209.52KB
返回 下载 相关 举报
电大1253+C语言程序设计A(7月)小抄参考_第1页
第1页 / 共9页
电大1253+C语言程序设计A(7月)小抄参考_第2页
第2页 / 共9页
电大1253+C语言程序设计A(7月)小抄参考_第3页
第3页 / 共9页
点击查看更多>>
资源描述
专业好文档试卷代号:1253中央广播电视大学2009-2010学年度第二学期“开放本科”期末考试C语言程序设计A试题2010.7一、单选题(每小题2分,共20分)1在每个C语言程序中都必须包含有这样一个函数,该函数的函数名为( )。A. main B. MAIN C. name D. function2每个C语言程序文件的编译错误分为( )类。A. 1 B. 2 C. 3 D. 43. 字符串a+b=12n的长度为( )。A. 6 B. 7 C. 8 D. 94. 在switch语句的每个case块中,假定都是以break语句结束的,则此switch语句容易被改写为( )语句。A. for B. while C. do D. if5. 在下面的do-while循环语句中,其循环体语句被执行的次数为( )。int i=0; do i+; while(i5)的相反表达式为_。6若x=5,y=10,则x!=y的逻辑值为_。7. 假定二维数组的定义为“int a35;”,则该数组所占存储空间的字节数为_。8. 使用“typedef char BB1050;”语句定义_为含有10行50列的二维字符数组类型。9. 字符串a:xxkfile.txt的长度为_。10假定p所指对象的值为25,p+1所指对象的值为46,则*+p的值为_。11. 假定一个数据对象为int*类型,则指向该对象的指针类型为_。12假定一个结构类型的定义为 “struct Aint a,b; A* c;”,则该类型的理论长度为_。13. 假定要访问一个结构对象x中的数据成员a,则表示方式为_。 三、写出下列每个程序运行后的输出结果(每小题6分,共30分) 1. #include void main() int i,j,k=0; for(i=0; i5; i+) for(j=i; j5; j+) k+; printf(%dn,k); 2. #include void main() int x=20; int i=2; while(ix) if(x%i=0) printf(%d ,i); x/=i; i+; 3. #include void main() int a8=70,63,54,95,40,75,90,66; int i, s=0; for(i=0; i=70 & ai=90) s+=ai; printf(s=%dn,s); 4. #include int WF(int x, int y) x=x+y; y+=x; return x+y; void main() int x=3, y=5; printf(%dn,WF(x,y); 5. #include int LA(int *a, int n) int i,s=0; for(i=0;in;i+) s+=ai; return s; void main() int a5=1,2,3,4,5; int b=LA(a,5)+LA(a+1,3); printf(b=%dn,b); 四、写出下列每个函数的功能(每小题6分,共12分) 1. int SG(int x) /x为大于等于2的整数 int i=2; if(x=2 | x=3) return 1; while(i*i=x) if(x%i=0) break; i+; if(i*idata; f=f-next; while(f) if(f-datax) x=f-data; f=f-next; return x; 假定struct IntNode的结点类型定义为: struct IntNode int data; struct IntNode* next; 函数功能: 五、按照题目要求编写程序或函数(每小题6分,共12分) 1. 编写一个主函数,计算1+3+32+.+310的值并输出,假定分别用i,p,s作为循环变量、累乘变量和累加变量的标识符。 2. 根据函数原型“int FF(int a, int n)”,编写函数定义,计算并返回数组an中所有元素之和。参考答案一、单选题(每小题2分,共20分)1. A 2. B 3. B 4. D 5. C6. C 7. A 8. C 9. A 10. B二、填空题(每小题2分,共26分)1. C 2. 2 3. float 4. 335. (x!=0 | y=5) 或:(x | y=5) 6. 1(真,true)7. 60 8. BB 9. 15 10. 4611. int* 12. 12 13. x.a三、写出下列每个程序运行后的输出结果(每小题6分,共30分)1. 152. 2 53. s=2354. 215. b=24四、写出下列每个函数的功能(每小题6分,共12分)1. 判断x是否为一个素数,若是则返回1,否则返回0。2. 求出并返回由f所指向的单链表中所有结点的最大值。五、按照题目要求编写程序或函数(每小题6分,共12分)1. #include void main() int i; int p=1; int s=1; for(i=1;i=10;i+) p*=3; s+=p; printf(%dn,s); 2. int FF(int a, int n) int i,sum=0; for(i=0; in; i+) sum+=ai; return sum; Winger Tuivasa-Sheck, who scored two tries in the Kiwis 20-18 semi-final win over England, has been passed fit after a lower-leg injury, while Slater has been named at full-back but is still recovering from a knee injury aggravated against USA.Both sides boast 100% records heading into the encounter but Australia have not conceded a try since Josh Charnleys effort in their first pool match against England on the opening day.Aussie winger Jarryd Hayne is the competitions top try scorer with nine, closely followed by Tuivasa-Sheck with eight.But it is recently named Rugby League International Federation player of the year Sonny Bill Williams who has attracted the most interest in the tournament so far.The Kiwi - with a tournament high 17 offloads - has the chance of becoming the first player to win the World Cup in both rugby league and rugby union after triumphing with the All Blacks in 2011.Id give every award back in a heartbeat just to get across the line this weekend, said Williams.The (lack of) air up there Watch mCayman Islands-based Webb, the head of Fifas anti-racism taskforce, is in London for the Football Associations 150th anniversary celebrations and will attend Citys Premier League match at Chelsea on Sunday.I am going to be at the match tomorrow and I have asked to meet Yaya Toure, he told BBC Sport.For me its about how he felt and I would like to speak to him first to find out what his experience was.Uefa hasopened disciplinary proceedings against CSKAfor the racist behaviour of their fans duringCitys 2-1 win.Michel Platini, president of European footballs governing body, has also ordered an immediate investigation into the referees actions.CSKA said they were surprised and disappointed by Toures complaint. In a statement the Russian side added: We found no racist insults from fans of CSKA. Baumgartner the disappointing news: Mission aborted.The supersonic descent could happen as early as Sunda.The weather plays an important role in this mission. Starting at the ground, conditions have to be very calm - winds less than 2 mph, with no precipitation or humidity and limited cloud cover. The balloon, with capsule attached, will move through the lower level of the atmosphere (the troposphere) where our day-to-day weather lives. It will climb higher than the tip of Mount Everest (5.5 miles/8.85 kilometers), drifting even higher than the cruising altitude of commercial airliners (5.6 miles/9.17 kilometers) and into the stratosphere. As he crosses the boundary layer (called the tropopause),e can expect a lot of turbulence.The balloon will slowly drift to the edge of space at 120,000 feet ( Then, I would assume, he will slowly step out onto something resembling an Olympic diving platform.They blew it in 2008 when they got caught cold in the final and they will not make the same mistake against the Kiwis in Manchester.Five years ago they cruised through to the final and so far history has repeated itself here - the last try they conceded was scored by Englands Josh Charnley in the opening game of the tournament.That could be classed as a weakness, a team under-cooked - but I have been impressed by the Kangaroos focus in their games since then.They have been concentrating on the sort of stuff that wins you tough, even contests - strong defence, especially on their own goal-line, completing sets and a good kick-chase. Theyve been great at all the unglamorous stuff that often goes unnoticed in the stands but not by your team-mates.It is as though their entire tournament has been preparation for the final.In Johnathan Thurston, Cooper Cronk, Cameron Smith and either Billy Slater or Greg Inglis at full-back they have a spine that is unmatched in rugby league. They have played in so many high-pressure games - a priceless asset going into Saturday.The Kiwis are a lot less experienced but winning a dramatic match like their semi-final against England will do wonders for their confidence.They defeated Australia in the Four Nations final in 2010 and the last World Cup, and know they can rise to the big occasion.第 9 页 共 9 页
展开阅读全文
相关资源
相关搜索

最新文档


当前位置:首页 > 办公文档


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!