33 lines
512 B
C++
33 lines
512 B
C++
#ifndef DEF_ZFRACTION
|
|
|
|
#define DEF_ZFRACTION
|
|
#include <iostream>
|
|
#include <string>
|
|
|
|
using namespace std;
|
|
|
|
|
|
class ZFraction{
|
|
public:
|
|
ZFraction(int a=1, int b=1);
|
|
|
|
|
|
ZFraction operator+(const ZFraction& x) const;
|
|
ZFraction& operator+=(const ZFraction& x);
|
|
|
|
ZFraction operator*(const ZFraction& x) const;
|
|
ZFraction& operator*=(const ZFraction& x) const;
|
|
|
|
private:
|
|
friend ostream& operator<<(ostream& o, const ZFraction& f);
|
|
|
|
int _a;
|
|
int _b;
|
|
};
|
|
|
|
|
|
|
|
|
|
#include "ZFraction.cpp"
|
|
|
|
#endif |