2つの正の整数の最大公約数を求めてc++classを使って書きます

476 ワード

#include 
using namespace std;

class Integer {
private:
	int _num;
public:
	//    
	Integer(int num) {
		_num = num;
	}
	//    Integer   b        
	int gcd(Integer b) {
		 int temp;
		 if (_num> a >> b;
	Integer A(a);
	Integer B(b);
	cout << A.gcd(B) << endl;
	system("pause");
	return 0;
}