浙江大学c程2005A试卷E(竺院)
浙江大学历年真题(都是07前的)快速下载(跨考网)索引

控制理论1995 控制理论1996 控制理论1997 控制理论1998 控制理论1999 控制理论2003 控制理论2004 控制理论2005 政治学1998 政治学1999 政治学2000 政治学2001 政治学2003 政治学2004 政治学2005 政治经济学1998 政治经济学1998答案 政治经济学1999 政治经济学1999答案 政学2000(甲)答案 政治经济学2001 政治经济学2001答案 政治经济学2002 教育与儿童心理学2002 教育学1998 教育学1999 教育学2000 教育学2000(乙) 教育学2000(甲) 教育学2001 教育学2002 教育学2003 教育学2004 教育学2005 教育学与儿童心理学2002 数学分析1998 数学分析1999 数学分析2000 数学分析2001 数学分析2002 数学分析2003 数学分析2004 数学分析2005 数学分析2007
日语二外2002 日语二外2003 日语二外2004 日语二外2005 日语二外2007 日语研究知识2001 日语研究知识2002 日语翻译与写作2003 日语翻译与写作2004 日语翻译与写作2005 日语翻译与写作2007 日语语言与文化2003 日语语言与文学2004 日语语言与文学2005 日语语言与文学2007 日语语言与文学化2005 普通心理学1998 普通心理学1999 普通心理学2000 普通心理学2000答案 普通心理学2001 普通心理学2001答案 普通心理学2002 普通心理学2002答案 普通物理1999(乙) 普通物理2000(乙) 普通物理2001(乙) 普通物理2002(乙) 普通物理2003(乙) 普通物理2003(甲) 普通物理2004(乙) 普通物理2004(甲) 普通物理2005(甲) 普通物理2007 有机化学1999(甲).pdf 有机化学1999(甲) 有机化学2000(甲) 有机化学2001(甲) 有机化学2002(甲) 有机化学2003(甲) 有机化学2004(乙) 有机化学2004(甲) 有机化学2005(甲) 有机化学2007 机械设计基础1998 机械设计基础1999 机械设计基础2000
浙大C++2005~2006春浙江大学考试答答案和评分标准

浙⼤C++2005~2006春浙江⼤学考试答答案和评分标准浙江⼤学2005–2006学年_春_季学期《⾯向对象程序设计》课程期末考试试卷开课学院:计算机学院,考试形式:闭卷考试时间:_2006_年_4_⽉_18_⽇,所需时间: 120 分钟,任课教师_________ 考⽣姓名: _____学号:专业: ________1. Write the output of the code below(20%):每题4分1)int aa1=53,aa2=69;void f(int a1,int &a2){a2=a1;a1+=a2;cout << aa1 << aa2 << endl; //看清楚题⽬aa2 -= 7;a2++;}void main(){f(aa1,aa2);cout << aa1 << aa2 <}535353472) class A{static int m; //careint n;public:A(int m,int n){this->m=m;this->n=n;}Print(){ cout << m <<"---" << n << endl;}};int A::m; //改错时候注意A a2(5,6);a1.Print();a2.Print();}5---45---63)char a['z'];for (char i='a';i<='z';i++)a[i] = 'A'+i-'a';cout << a['e'] << endl;for (char i='a';i<='z';i++)a[i] = '1'+i-'a';cout << a['e'] << endl;E54)#includeusing namespace std;class A {int i;public:A():i(10) { cout << "A() " <virtual ~A() { cout << "~A() " << "\t"; } virtual void f() { i+=11; cout << "A::f() " < void g() { i+=12; cout << "A::g() "< };class B : public A {int i;public:B():i(20) { cout << "B() " <~B() { cout << "~B() " << "\t"; }void f() { i+=22; cout << "B::f() " <void g() { i+=12; cout << "B::g() "<{return B();}int main(){A* p = new B();p->f();cout <A a;B b = gen();a = b;a.f();cout <b.g();delete p;return 0;}A() 10 A::f() 21 B() 20 B::f() 42 B::f() 64A() 10 A::f() 21 A() 10 A::f() 21 B() 20 B::f() 42 A::f() 32 B::g() 54 ~B() ~A() ~B() ~A() ~A()此题答案不要求tab的对齐,但是如果存在换⾏错误(多余的或缺少的),所有的换⾏错误合计扣1分5)void main(){int m = 555;int n = 666;int &k = m;k++;cout << m <<”----“ << n << endl;k = n;k++;cout << m <<”----“ << n << endl;}556----666667----666D1、In C++ Language,function prototype doesn’t identify ( )A. The return type of the function.B. The number of arguments of the functionC. The type of arguments of the function.D. The functionality of the functionB 2、In C++ program, objects communicate each other by ( )A. InheritanceB. Calling member functionsC. EncapsulationD. Function overloadingB 3、For an arbitrary class,the number of destructor function can’t be bigger than ( )A. 0B. 1C. 2D. 3C 4、 Suppose a class is defined without any keywords such as public, private and protected,all members default to: ( )A. publicB. protectedC. privateD. staticC 5、About inline function, which statement is correct? ( )A. When the program is executed, inline function will insert the object code to every place where this function is called.B. When the program is compiled, inline function will insert the object code to every place where this function is called.C. Inline function must be defined inside a class.D. Inline function must be defined outside a class with keyword “inline”.B 6、During public inheritance, which statement is incorrect concerning the base class objects and the derived class objects? ( )A. Derived class objects can be assigned to base class objects.B. Derived class objects can initialize base class references.C. Derived class objects can access the members of base class.D. The addresses of derived class objects can be assigned to base class pointers.C 7、For the class definition:class A{public:};class B: public A{public:void func1( ){cout<< ″ class B func 1 ″ <virtual void func2( ){cout<< ″ class B func 2 ″ <};Which statement is correct? ( )A. Both A::func2( ) and B::func1( ) are virtual functionsB. Both A::func2( ) and B::func1( ) are not virtual functionsC. B::func1( ) is virtual function, while A::func2( ) is not virtual functionD. B::func1( ) is not virtual function, while A::func2( ) is virtual function3. Please correct the following programs(point out the errors and correct them)(15%) 1) 6分,每错2分class A{protected:static int k;int m;public:};int A::k;class B : public A{int n;public:static void F(int k){this->A::k = k;}void F2(int m){this->m = m;}};void main(){B b1,b2;b2.F2(5);}2)2分char a[3];const char *const ptr = a;const char c = 'a';ptr = &c3) 2分class base{...public:virtual void f(void)=0;virtual void g(void)=0;}class derived: public base{...public:virtual void f(void);virtual void g(void);};derived d;4) 5分,前3错各1分,最后⼀题错2分(基本正确给⼀分),class A {int *m_ip;public:A(int *ip = NULL){if(ip){m_ip = new int[5];::memcpy(m_ip,ip,sizeof(int)*5);}elsem_ip = NULL;~A(){delete m_ip; //改成 delete [] m_ip更好}A operator+(const A &a) const { // (1)(2)A temp(m_ip);for (int i=0; i<5; i++)temp.m_ip[i] += a.m_ip[i];return temp;}const A &operator=(const A &a){ // (3)if(a.m_ip){m_ip = new int[5];::memcpy(m_ip,a.m_ip,sizeof(int)*5);}elsem_ip = NULL;return *this;}friend ostream operator<<(ostream &,const A &); };ostream operator<<(ostream &out ,const A &a); // (4) {out << “(“ ;for (int i=0;i<4;i++)out << a.m_ip[i] << “,”;return out << a.m_ip[5] << “)”;}// Suppose the following code is correctvoid main(){const int k[5]={3,5,6,2,1};const A a1(k),a2(k);A a3(k);a3 = a1+a2;cout << a3 << endl;4、Fill in the blanks(30%)每格2分1)The function template MaxMin() can find out the max and min of a two dimension array,row is first dimension of length and col is second dimension of length . #includetemplate void MaxMin(T* array,int row,int col){T max = array[0],min = array[0];for(_int i=0 ;ifor( int j=0 ;j{if( maxmax = array[i*row+j];if( min > array[i*col+j] )min = array[i*row+j];}cout << "max=" << max << endl;cout << "min=" << min << endl;}void main(){int ai[2][3]={{8,10,2},{14,4,6}};MaxMin( (int*)ai, 2, 3 );}2) Please fill in the suitable code to make the program results 60。
浙江大学2005-2006学年春夏学期《常微分方程》期末考试

浙江大学2005-2006学年春夏学期《常微分方程》期末考试
数学系必修课 方道元 2006-07-05
Moqi@88 根据记忆整理,仅供参考
一、(21分)考虑初值问题0
220x x dy x y dx y y =⎧=+⎪⎨⎪=⎩,其中00,x y 是实数。
1. 写出毕卡叠代序列的前三项
2. 应用解的存在定理确定000,0x y ==时解的最大存在区间
3. 讨论一般情形解的最大存在区间
二、(16分)已知方程30xy y xy y ′′′′′′+−−=的一个解1y x
=
,求出方程的通解 三、(20分)求解下述初值问题 (0)(0)0y y tgx y y ′′+=⎧⎨′==⎩
四、(16分)求解线性方程组
3253232dx x y z
dt dy x y z dt
dz x y z dt ⎧=−−+⎪⎪⎪=−−⎨⎪⎪=−−⎪⎩
五、(20分)求系统
3
(0)16dx y dt dy x y x dt
αα⎧=⎪⎪≥⎨⎪=−−+⎪⎩其中 的奇点并确定其类型。
画出草相图并讨论系统稳定性。
六、(7分)求解如下边值问题0,(0)0,(1)(1)0x x x x x λ′′′+==+=。
浙江大学2005数学分析

浙江大学2005数学分析 1. 计算定积分:20sin xdx π⎰解:22001cos 21sin cos 2242x xdx dx xdx πππππ-==-=⎰⎰⎰ 2. 假设f(x)在[0,1]Rieman可积,1()f x dx =⎰11lim 4ln[1()]nn i i f n n →∞=+∑ 解:利用可积的定义和Taylor 展开作3. 设a,b,c 是实数,b>-1,c ≠0,试确定a,b,c ,使得30sin limln(1)x x b ax xc t dtt →-=+⎰解:不断利用L ’Hospital 法则4. f(x)在[a,b]上连续,对于1[,],[,],|()||()|2x a b y a b f y f x ∀∈∃∈≤,求证:[,],()0a b f ξξ∃∈=证明:利用实数系的几个定理就可以了 5.(1)设f(x)在[a,+∞]上连续,且()af x dx +∞⎰收敛,证明:存在数列{}[,)n x a ⊂+∞,使得满足,lim ,lim ()0n n n n x f x →∞→∞=+∞=(2) 设f(x)在[a,+∞]上连续,f(x)≥0,且()af x dx +∞⎰收敛,问:是否必有lim ()0n n f x →∞=,为什么? 证明:(1)此题也可以用反证法来解决,也非常简单。
(2)不是,构造一个锯齿形的函数5. 设f(x)在[0,+∞]具有二阶连续导数,且已知0(0,)sup |()|x M f x ∈+∞=和2(0,)sup |"()|x M f x ∈+∞=都是有限数,求证: 证明:(1) 根据Taylor 展开: (2) 由题1的结论:7.设f(x)在任何有限区间上Rieman 可积,且|()|f x d x+∞-∞⎰收敛,证明:lim ()sin 0n f x nxdx +∞-∞→∞=⎰证明:分成两段,然后把它化成级数来考虑,做的有点麻烦。
2005年浙江大学外国语言文化与国际交流学院252二外俄语考研真题及详解【圣才出品】

2005年浙江大学外国语言文化与国际交流学院222二外俄语考研真题及详解I.选择题(40分)请选择一项正确答案,在答题纸的相应位置上涂黑。
1. Мы уже к дому, как вдруг пошёлдождь.А. вышлиВ. подходилиС. отходилиD. пошли【答案】B【解析】句意:我们已经快要到家了,忽然下起了雨。
выйти意为“走出”,为完成体动词。
подходить意为“快到,走近”,符合句意。
отходить意为“离开”。
пойти意为“开始走,前往”。
故正确答案为B。
2. как он уехал из Пекина, мы ни разу не виделись.А. КогдаB. ПокаС. С тех порD. Только что【答案】C【解析】句意:从他离开北京我们一次也没有见过。
с тех поркак意为“自从……”,符合句意。
故正确答案为C。
3. Совет Академии ему премию первой степени за отличную работу.А. вручилВ. присудилС. наградилD. выдал【答案】B【解析】句意:科学院委员会因他的出色工作为他颁发一等奖。
вручить кому что指颁发某种有重要意义的东西,常用于庄严正式的场合。
присудить кому что指经过评定委员会等组织讨论决定授予某人奖金、奖状、称号、学位等,符合句意。
наградить кого-что чем多指物质奖励,如奖章、奖状、奖品等。
выдавать кому что强调授予、颁发行为本身。
故正确答案为B。
4. Вечером больная тётя вдруг почувствовала такую слабость, что она едва не на землю.А. отпустиласьВ. спустиласьС. опустиласьD. пропустилась【答案】C【解析】句意:晚上生病的阿姨忽然感觉身体虚弱,差点摔到地上。
浙江大学2005年高等代数试题

浙江大学2005年高等代数试题由mylinco 整理,浙江工业大学,数学与应用数学05011、(10分)设整系数多项式()f x 的次数是2n m =或2+1n m =(其中m 为正整数)。
证明:如果有(21)k m ≥+个不同的整数1,k αα 使()i f α取值1或1-,则()f x 在有理数域上不可约。
(提示:用反证法)2、(10分)设A 是n 阶矩阵,11(,),(,)T T n n X x x Y y y == ,a 是一个数。
(1)求证:*0T T AY X A Y X =-。
(2)进一步,再证:*T T AY a A X A Y X a =-。
(其中*A 表示A 的伴随矩阵) 3、(10分)设1,,s ξξ 是某个齐次线性方程组的一个基础解系,1,,k ηη 是该齐次方程组的k 个线性无关的解。
证明:若k s <,则在1,,s ξξ 中必可取出s k -个向量使与1,,k ηη 共同构成该齐次方程组的一个基础解系。
4、(10分)设A 是n s ⨯矩阵,证明:秩()A r =的充分必要条件是存在两个列满秩的矩阵n r B ⨯和s r C ⨯使TA BC =。
5、(20分)设12,T T 为线性空间V 的两个线性变换,若有V 的可逆线性变换S 使112T S T S -=,则称1T 与2T 相似。
证明:1T 与2T 相似的充要条件是:存在可逆线性变换S ,使对V 中任一向量α,由1T αβ=可得2()T S S αβ=。
6、(20分)若把所有n 阶实对称矩阵按合同关系分类,问共有几类(说明原因)?每一类最简单的矩阵是什么?7、(20分)(1)在2R 中內积定义为1122,4x y x y x y <>=+,(其中21212(,),(,)T x x x y y y R ==∈), 令{}:1S x x ==,表示向量的长度,说明S 是什么形状的图形,并画出草图。
(2)令:230,,,,a b W a b c d a b c d R c d ⎧⎫⎡⎤=-++=∈⎨⎬⎢⎥⎣⎦⎩⎭。
2005年普通高等学校招生全国统一考试(浙江卷)

2005年普通高等学校招生全国统一考试(浙江卷)数 学(文史类)第Ⅰ卷 (选择题 共60分)一、选择题:本大题共10小题,每小题5分,共50分在每小题给出的四个选项中,只有一项是符合题目要求的(1)函数sin(2)6y x π=+的最小正周期是A .2πB .πC .2πD .4π (2)设全集{}1,2,3,4,5,6,7U =,{}1,2,3,4,5P =,{}3,4,5,6,7Q =,则()U P Q u ð=A .{}1,2B .{}3,4,5C .{}1,2,6,7D .{}1,2,3,4,5 (3)点(1,-1)到直线10x y -+=的距离是( )(A)21 (B) 32 (C) 2 (D)2(4)设()1f x x x =--,则1()2f f ⎡⎤=⎢⎥⎣⎦( )(A) 12- (B)0 (C)12(D) 1(5)在54(1)(1)x x +-+的展开式中,含3x 的项的系数是( )(A)5- (B) 5 (C) -10 (D) 10(6)从存放号码分别为1,2,…,10的卡片的盒子中,有放回地取100次,每次取一张卡片并记下号码统计结果如下:则取到号码为奇数的频率是A .0.53B .0.5C .0.47D .0.37(7)设α、β 为两个不同的平面,l 、m 为两条不同的直线,且l ⊂α,m ⊂β,有如下的两个命题:①若α∥β,则l ∥m ;②若l ⊥m ,则α⊥β. 那么(A) ①是真命题,②是假命题 (B) ①是假命题,②是真命题 (C) ①②都是真命题 (D) ①②都是假命题(8)已知向量(5,3)a x =-,(2,)b x =,且a b ⊥,则由x 的值构成的集合是 A .{}2,3 B .{}1,6- C .{}2 D .{}6 (9)函数31y ax =+的图象与直线y x =相切,则a = A .18B .14C .12D .1(10)设集合{}(,)|,,1A x y x y x y --=是三角形的三边长,则A 所表示的平面区域(不含边界的阴影部分)是( )(A) (B) (C) (D)第Ⅱ卷 (非选择题 共100分)二、填空题:本大题共4小题,每小题4分,共16分把答案填在答题卡的相应位置11.函数2xy x =+(x ∈R ,且x ≠-2)的反函数是_________. 12.设M 、N 是直角梯形ABCD 两腰的中点,DE ⊥AB 于E (如图).现将△ADE 沿DE 折起,使二面角A -DE -B 为45°,此时点A 在平面BCDE 内的射影恰为点B ,则M 、N 的连线与AE 所成角的大小等于_________.13.过双曲线22221x y a b-=(a >0,b >0)的左焦点且垂直于x 轴的直线与双曲线相交于M 、N 两点,以MN 为直径的圆恰好过双曲线的右顶点,则双曲线的离心率等于_________.14.从集合{P ,Q ,R ,S }与{0,1,2,3,4,5,6,7,8,9}中各任取2个元素排成一排(字母和数字均不能重复).每排中字母Q 和数字0至多只能出现一个的不同排法种数是_________.(用数字作答).三、解答题:本大题共6小题,每小题14分,共84分解答应写出文字说明,证明过程或演算步骤15.已知函数()2sin cos cos 2f x x x x =+(Ⅰ) 求()4f π的值;(Ⅱ) 设α∈(0,π),()22f α=sin α的值.16.已知实数,,a b c 成等差数列,1,1,4a b c +++成等比数列,且15a b c ++=,求,,a b c17.袋子A 和B 中装有若干个均匀的红球和白球,从A 中摸出一个红球的概率是31,从B 中摸出一个红球的概率为p .(Ⅰ) 从A 中有放回地摸球,每次摸出一个,共摸5次求(i )恰好有3摸到红球的概率;(ii )第一次、第三次、第五次均摸到红球的概率.(Ⅱ) 若A 、B 两个袋子中的球数之比为1:2,将A 、B 中的球装在一起后,从中摸出一个红球的概率是25,求p 的值.18.如图,在三棱锥P -ABC 中,AB ⊥BC ,AB =BC =12PA ,点O 、D 分别是AC 、PC 的中点,OP ⊥底面ABC . (Ⅰ)求证OD ∥平面PAB(Ⅱ) 求直线OD 与平面PBC 所成角的大小;19.如图,已知椭圆的中心在坐标原点,焦点12,F F 在x 轴上,长轴A 1A 2的长为4,左准线l 与x 轴的交点为M ,|MA 1|∶|A 1F 1|=2∶1. (Ⅰ)求椭圆的方程;(Ⅱ)若点P 在直线l 上运动,求∠F 1PF 2的最大值.20.函数f (x )和g (x )的图象关于原点对称,且f (x )=x 2=2x . (Ⅰ)求函数g (x )的解析式;(Ⅱ)解不等式g (x )≥f (x )-|x -1|.(Ⅲ)若()()()1h x g x f x λ=-+在[]1,1-上是增函数,求实数λ的取值范围2005浙江卷试题及答案参考答案一、选择题:本题考查基本知识和基本运算每小题5分,满分50分(1)B (2)A (3)D (4)D (5)C (6)A (7)D (8)C (9)B (10)A 二、填空题:本题考查基本知识和基本运算每小题4分,满分16分(11)()2,11xy x R x x=∈≠-且;(12)90︒;(13)2;(14)5832三、解答题:(15)本题主要考查三角函数的倍角公式、两角和的公式等基础知识和基本的运算能力分14分解:(Ⅰ)∵()sin2cos2f x x x =+∴sin cos 1422f πππ⎛⎫=+=⎪⎝⎭(Ⅱ) cos sin 2f ααα⎛⎫=+= ⎪⎝⎭∴1sin ,cos 424ππαα⎛⎫⎛⎫+=+= ⎪ ⎪⎝⎭⎝⎭13226sin sin 442ππαα⎛⎫=+-=⨯= ⎪⎝⎭∵()0απ∈,, ∴sin 0α>, 故sin α=(16)本题主要考查等差、等比数列的基本知识考查运算及推理能力满分14分解:由题意,得()()()()()()2151221413a b c a c b a c b ⎧++=⎪⎪+=⎨⎪++=+⎪⎩由(1)(2)两式,解得5b = 将10c a =-代入(3),整理得213220211,2,5,811,5, 1.a a a a a b c a b c -+=========-解得或故或经验算,上述两组数符合题意。
2005年高考.浙江卷.文科数学试题精析详解

e=2
12.从集合 P,Q, R, S 与 0,1, 2,3, 4,5,6,7,8,9 中各任取 2 个元素排成一排(字母和数
字均不能重复).每排中字母 Q 和数字 0 至多只能出现一个的不同排法种数是_________.(用 数字作答)
解:分三种情况:情况 1.不含 Q、0 的排列: C32 C92 P44 ;情况 2.0、Q 中
解:命题②有反例,如
(B) ①是假命题,②是真命题 (D) ①②都是假命题
图中平面α∩平面β=直线 n,l , m
且 l∥n,m⊥n,则 m⊥l,显然平面α不垂直平面β
故②是假命题;命题①显然也是假命题,
因此本题选(D)
8.已知向量
a
x
5, 3 , b
2,
x
,且
a
b
,则由
x
的值构成的集合是(
13.过双曲线
x2 a2
y2 b2
1a
0, b
0 的左焦点且垂直于
x
轴的直线与双曲线相交
于 M、N 两点,以 MN 为直径的圆恰好过双曲线的右顶点,则双曲线的离心率等于 _________.
解:由题意可得 b2 a c ,即 c2-a2=a2+ac,化成关于 e 的方程 e2-e-2=0,解得 a
2005 年普通高等学校招生全国统一考试(浙江卷)
数学试题(文科)
第Ⅰ卷 (选择题 共 50 分)
一、选择题:本大题共 10 小题,每小题 5 分,共 50 分。在每小题给出的四
个选项中,只有一项是符合题目要求的。
1.函数
y
sin
2x
6
的最小正周期是(
)
(A)
2
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
浙江大学2005-2006学年冬季学期《C Programming》课程期末考试试卷开课学院:计算机学院, 考试形式:闭卷考试时间:2006年1月11日, 所需时间:120 分钟,任课教师考生姓名:学号:专业:(注意:答题内容必须写在答题卷上,写在本试题卷上无效) Section 1: Single Choice(2 mark for each item, total 20 marks)1. If x is a float variable, the value of expression (x = 7/2, x+1) is _____.A.3 B.3.5 C.4 D.4.52.The value of expression sizeof (“\\total=%lf\\\n”) is______.A.13 B.14 C.15 D.163. The statement ______ is correct if a is an integer variable and b is a doublePrecision float variable.A.scanf(“%d,%f”, &a, &b);B.scanf(“a=%d b=%*f”, &a, &b);C.scanf(“%d%*lf”, &a, &b);D.scanf(“%d%*lf”, &a );4.The value of expression strcmp (“internet”, “intranet”) is______.A.positive B.negative C.zero D.uncertain5. The expression! (x>0&&y<0) is equivalent to _____.A.x<=0||y>=0 B.!x>0&&!y<0 C.!x>0||!y<0 D.!(x>0)&&!(y<0)6. If variables are defined, the value of expression_____ is not 1.A.2^3 B.1<<1/2 C.(a=1,b=2,a>b) D.!’\0’7. If variables are defined and assigned correctly, the expression_____ is wrong.A.float(256) B.a>b>5 C.a,2,b D.5&&68. The following code fragment prints out _____.int i=5;while (i-->1){if(i%2) printf("*");else continue;printf("#");}printf("$\n");A.*#*#*#$ B.#*#*#*$ C.#*#*$ D.*#*#$9. With regard to the following definition:struct {int len;《C Programming》TEST PAPER, Jan 11, 2006 1 / 8char *str;} s[2]={{10,”hello”},{20,”world”}},*p=s;Operator ++ in the expression *p++->str is applied on _____.A.str B.pointer pC.the content which p points to D.None of the above10. Among the following statements, _____ is the most correct statement.char *p, str[]=“hello”;A.strcpy(p, “world”);B.p=str++;C.p=“world”+1;D.strcat(str, “world”);Section 2: Fill in the blanks(2 mark for each item, total 30 marks)1. If ch is an uppercase character variable, the expression can be written as __’A’+’Z’-ch____according to the changing rule: ’A’->’Z’,’B’->’Y’,’C’->’X’……2. The value of expression strlen(“http:\\”) is___20___.3. The following code fragment prints out __020___.printf("%#o\n", (010<<1^1)&(0xe<<1));4. Write a conditional expression___(x>0)?(1/x): (x==0)?0: (-2/x)___ to calculate the value of y.1/x x>0y= 0 x=0-2/x x<05. The following code fragment prints out ___12___.#define FB(a,b) (a*b+1)int k=3;k=FB(FB(k+1,k-1),k)-7;printf("%d",k);6. After running the following code fragment, the value of a is ___-1__.int a=-1,x=10,y=20,ok1=5,ok2=0;if(x<y)if(y!=10)if(!ok1)a=1;elseif(ok2) a=10;7. The following code fragment prints out __6,4,60___.int i,j,k=0;for (i=0, j=10; i<=j; i++, j--)k+=i+j;printf ("%d,%d,%d", i,j,k);8. The following code fragment prints out ___-2,1__.int k=2, a=1;while(k--!=-1) {《C Programming》TEST PAPER, Jan 11, 2006 2 / 8do {a*=k;a++;} while (k--);}printf("%d,%d",k,a);9. The following code fragment prints out __a=2,b=1___.int x=1,y=0,a=0,b=0;switch(x) {case 1:switch(y) {case 0: a++; break;case 1: b++; break;}case 2:a++; b++; break;}printf(“a=%d,b=%d”,a,b);10. Writing the declaration with typedef, which makes NAME a synonym for a character pointerarray, 20 elements _____. typedef char *NAME[20];11. With the code fragment bellow, function call f(3), the return value is __11___.f (int n){ return ((n>0) ? f(n-1)+2*f(n-2) :1); }12. The output of the following program is __3___.# include <stdio.h>int f(){ static int k=0;k++;return k;}void main(){ int k;for(k=0;k<2;k++) f();printf(“%d”, f());}13. The output of the following program is __3#1#1#___.#include <stdio.h>main(){int a=1,b=2,m;《C Programming》TEST PAPER, Jan 11, 2006 3 / 8int s(int,int *);m=s(a,&b);printf(“%d#%d#%d#”,m,a,b);}int s(int a,int *b){int m;m = a+*b;*b -= a;return m;}14.In the following command-line program run.c, the output after running “run –abc –nls world”is ___u#-___.#include <stdio.h>main(int agrc, char *argv[]){printf(“%c#%c”, *++argv[0], (*++argv)[0]);}15.After executing the following block, the value of variable i is __6____.static int a[3][4]={{1,2,3},{4,5,6}}, i;i= a[2][-2] + a[1][3];Section 3: Read each of the following programs and answer questions (5marks for each item, total marks: 30)1.The output of the following program is ___4#0#4$-2$____.#include <stdio.h>void main(void){int x,y=-2,z;if((z=y)<0) x=4;else if(y==0) x=5;else x=6;if(z=(y==0))x=5;printf("%d#%d#",x,z);if(x=z=y)x=4;printf("%d$%d$",x,z);}2.The output of the following program is __3#3#6#3#2#0#___.《C Programming》TEST PAPER, Jan 11, 2006 4 / 8#include <stdio.h>int x,y,z;void p(int x, int *y){ int z;++x;++*y;z=x+*y;printf(“%d#%d#%d#”, x,*y,z);}void main(){ x=y= 2;p(y, &x);printf(“%d#%d#%d#”, x,y,z);}3.The output of the following program is ___95#75#0#60#85#____.#include <stdio.h>void main( ){ char ch, *s = "ACEDB";int x;while(*s != 0){f(*s++, &x);printf("%d#", x);}}int f(char ch, int *x){*x = 0;switch (ch) {case 'A': *x = 95; break;case 'B': *x = 85; break;case 'C': *x = 75; break;case 'D': *x = 60; break;}}4.The output of the following program is ___60,2#30,2#15,3#5,5#____.#include <stdio.h>void main(){ void div(int*, int*);int a[5] = {-1, 0, 60, 45, 34 }, i = 0, j = 2;《C Programming》TEST PAPER, Jan 11, 2006 5 / 8while(a[i] <= 0) i++;while(a[i] != 1) div(a+i, &j);}void div(int *n, int *k){ if(*n%*k == 0) {printf("%d,%d#", *n, *k);*n /= *k;}else (*k)++;}5.The output of the following program is ___15____.#include <stdio.h>int f(int a[], int n){ int cur, final, j;cur=final=0;for(j=0; j<n; j++) {cur += a[j];if(cur > final) final= cur;else if(cur<0) cur=0;}return final;}void main(){int a[]={1,2,-4,3,2,6,-1,5,-4,-7,8};printf(“%d\n”, f(a, sizeof(a)/sizeof(int)));}6.The output of the following program is ___13045____.#include <stdio.h>int f(int n, int m){ int n1, m1, result=0;if (n && m)n1=n%10;m1=m%10;if (n1==m1) result= f(n/10, m/10)*10;else result = f(n/10, m/10)*10 + ((n1>m1)?n1:m1);return result;} else return n+m;}void main()《C Programming》TEST PAPER, Jan 11, 2006 6 / 8{printf("%d\n", f(12345, 3333));}Section 4: According to the specification, complete each program (2 mark for each blank, total: 20 marks)1.The following program is to calculate the sum of the first n items of the sequence as 1/2, 2/3, 3/5, 5/8, 8/13, 13/21,….#include <stdio.h>main(){ float x,y,t, sum=0;int i,n;x=1,y=2;scanf("%d", &n);for(i=0;___(1)____; i++) {sum+= x/y;t=x;____(2)___;____(3)___;}printf("%f", sum);}(1) i<n(2) x=y(3) y=y+t《C Programming》TEST PAPER, Jan 11, 20067 / 82.There is an increasing ordered character list in a text file file1. The following program read in this list, calculate the number of duplicates(重复) and write each character and its frequency of occurrence (> 1) (大于1的出现次数) into the file file2. For example, if the file1 contains list “abbcdddeffg” , the list “ab2cd3ef2g” will be written into file2.#include <stdio.h>main(){ FILE *fp1, *fp2;char last, c;int count=0;fp1=fopen("file1", "r");fp2=fopen("file2", "w");if (_________(4)_____________) exit(0);last='\0';while (______(5)_____________) {count++;if (c!=last) {if (count>1) ________(6)________________;count=0;fputc(c,fp2);last=___(7)____;}}fclose(fp1);fclose(fp2);}(4) fp1==NULL || fp2==NULL(5) (c=fgetc(fp1))!=EOF(6) fprintf(fp2,”%d”,count)(7) c《C Programming》TEST PAPER, Jan 11, 20068 / 83.There is a simple chaining list h (may be NULL). The following two functions: void push(int n) to insert the n into the head of the list, and void pop() to delete the first node from the list.For example,after push(1), list will be:struct node {int info;struct node *next;} *h;void push(int n){ struct node *t;t= _________(8)________;t->info=n;if (h==NULL) t->next=NULL;else _______(9)________;h=t;}void pop(){ struct node *t;if (h==NULL) return NULL;else { t=h;_______(10)________;free(t);}}(8) (struct node*)malloc(sizeof(struct node))(9) t->next=h(10) h=t->next《C Programming》TEST PAPER, Jan 11, 20069 / 8。