-------{Choi.h}---------
{Choi.cpp}----------
{Choi2.cpp}-----------
~cpp class GCD{ private: int x,y; public: int big,small,remain; GCD(); ~GCD(); void replace(){ if (x>y) { big=x; small=y; } else { big=y; small=x; } } void mod(); void disp(); };------
~cpp #include <iostream.h> #include "Choi.h" GCD::GCD(){ cout<<"x="; cin>>x; cout<<"y="; cin>>y; } GCD::~GCD(){ } void GCD::mod(){ while (small!=0){ remain=big%small; big=small; small=remain; } } void GCD::disp(){ cout<<"x="<<x<<" y="<<y<<endl; cout<<"GCD="<<big<<endl; }---------
~cpp #include "Choi.h" void main(){ GCD Max; Max.replace(); Max.mod(); Max.disp(); }
대 C++ 는데 ㅡ
만들.. , 뒤 ..
만들.. , 뒤 ..