正在加载图片...
p米=B; s十=P; cout<<"s="<<s<<endl; } 运行结果: 2.include<iostream.h> class CE{ private: int a,b; int getmin()(return (a<b?a:b);} public: int c; void SetValue(int xl,int x2,int x3){ a=x1;b=x2;c=x3; int GetMin(); }; int CE::GetMin(){ int d=getmin(); return(d<c?d:c); void main() { intx=5,y=12,z=8; CE ep=new CE; ep->SetValue(x+y,y-z,10); cout<<ep->GetMin()<<endl; 运行结果: 66P*=B s十=P; cout+ "s="+ s+ endl; } 运行结果 : 2.#include< iostream, h> class CE private: int a,b; int getmin(){return <a<b? a; b); public: m t c void SetValue(int x1,int x2,int x3){ a=x1;b = x2;c= x3 int GetM in() int CE::GetMin< ) int d = retu rn getmin( ); (d<c? d:c); void main() int x = 5,y=12,z=8; CE * ep=new CE; ep一>SetValue<x-}-y,y一z,10); cout+ ep一>GetMin() + endl; 运行结果 : 66
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有