Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by deptraikosai69 ( 5 years ago )
#include<iomanip>
#include<iostream>
#include<cstdlib>

using namespace std ;

class phanso{
		//thuoc tinh la private
	private:// duoc truy cap trong lop hoac trong ham ban
		int tu,mau;
	//phuong thuc (la public) hoac ham thanh vien goi tat la ham
	public:
		//xay dung ham nhap 
		void nhap(){
			cout<<"nhap tu :";cin>>tu;		
			cout<<"nhap mau :";cin>>mau;

		}
		//xay dung ham goi tu
		int get_tu(){
			return tu;
		}
		int get_mau(){
			return mau;
		}
};
int main(){
	int n;
	phanso ps1;
    #include<iomanip>
#include<iostream>
#include<cstdlib>

using namespace std ;

class phanso{
		//thuoc tinh la private
	private:// duoc truy cap trong lop hoac trong ham ban
		int tu,mau;
	//phuong thuc (la public) hoac ham thanh vien goi tat la ham
	public:
		//xay dung ham nhap 
		void nhap(){
			cout<<"nhap tu :";cin>>tu;		
			cout<<"nhap mau :";cin>>mau;

		}
		//xay dung ham goi tu
		int get_tu(){
			return tu;
		}
		int get_mau(){
			return mau;
		}
};
int main(){
	int n;
    
	ps1.nhap();              //khi goi phai gan voi 1 doi tuong, cu the trong vi du nay la gan voi doi tuong ps1
	                         // gan voi doi tuong phai co dau cham
	cout<<"tu cua ps1 la :"<<ps1.get_tu()<< endl <<"mau cua ps1 la :"<<ps1.get_mau();
	
	return 0;
}

 

Revise this Paste

Children: 119767
Your Name: Code Language: