正在加载图片...
得分 评卷人 四、理解问答题(分别写出前2小题的程序运行结果和后2小题的函 数功能。每小题6分,共24分) 1.#include(iostream.h> const int B=2; void main() { int p=1,s=1; while(s<20)( p*=B; s十=pi } cout<<"s="<<<<endl; } 运行结果: 2.#include(iostream.h) class CE{ private: int a,b,c; int getmin()(return (a<b?a:b);) public: void SetValue(int xl,int x2,int x3){ a=x1;b=x2;c=x3: int GetMin()(int d=getmin();return (d(c?d:c);) }; void main() { intx=5,y=12,z=8; CE ep=new CE; ep-)Set Value(x,y,z); cout((ep->GetMin()((endl; 运行结果: 63|得分|评卷人| I I I 四、理解问答题{分别写出前 2小题的程序运行结果和后 J、题的画 数功能。每小题 1. :j:j: include<iostream. h) const int B=2; void mainO int p=l ,s=l; while(s<20) { s+=p; cout<<"s= "<<s<<endl; 运行结果 2. :j:j: include< iostream. h) class CE { pnvate: int a , b ,c; int getminO {return (a< b? a: b) ;} public: void SetValue(int xl ,int x2 , int x3) { a=xl; b=x2; c=x3; int GetMinO {int d=getminO; return (d<c'! d: c) ; } void mainO int x=5 ,y=12 ,z=8; CE 祷ep=new CE; ep 一)SetValue(x,y ,z) ; cout«ep 一)GetMinO <<endl; 运行结果 63
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有