









سوسن
خذي تسلي
كود:#include<iostream.h> enum resolution{low,medium,hight}; class display{ int width; int hight; resolution res; public: void set_dim(int w,int h) {width=w; hight=h; } void get_dim(int &w,int &h) {w=width; h=hight; } void set_res(resolution r) {res=r; } resolution get_res() {return res; } }; char names[3][7]={"low","medium","hight"}; void main() { display display_modes[3]; int i,w,h; display_modes[0].set_res(low); display_modes[0].set_dim(640,480); display_modes[1].set_res(medium); display_modes[1].set_dim(800,600); display_modes[2].set_res(hight); display_modes[2].set_dim(1600,1200); cout<<"Avilable Dispaly Modes:\n\n"; for(i=0;i<3;i++) {cout<<names[display_modes[i].get_res()]<<":"; display_modes[i].get_dim(w,h); cout<<w<<" "<<"by"<<" "<<h<<endl; } }
الذين يشاهدون الموضوع الآن: 1 (0 من الأعضاء و 1 زائر)
مواقع النشر (المفضلة)