#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
class Banding
{
friend istream& operator>>(istream&, Banding&);
public:
Banding() {};
void bandingkan()
{
int maks = x;
if (y > maks) maks = y;
if (z > maks) maks = z;
cout << endl << endl << "Bilangan terbesar : " << maks;
}
private:
int x, y, z;
};
istream& operator>>(istream& in, Banding& bilangan)
{
cout << "Bilangan pertama = ";
cin >> bilangan.x;
cout << "Bilangan kedua = ";
cin >> bilangan.y;
cout << "Bilangan ketiga = ";
cin >> bilangan.z;
return in;
};
int main(int argc, char** argv) {
Banding bilangan;
cin >> bilangan;
bilangan.bandingkan();
return 0;
}
Tidak ada komentar:
Posting Komentar