lab.cpp/tp2/ZFraction.h

33 lines
512 B
C
Raw Normal View History

2016-03-05 22:37:08 +00:00
#ifndef DEF_ZFRACTION
#define DEF_ZFRACTION
#include <iostream>
#include <string>
using namespace std;
class ZFraction{
public:
ZFraction(int a=1, int b=1);
2016-03-06 16:29:02 +00:00
ZFraction operator+(const ZFraction& x) const;
ZFraction& operator+=(const ZFraction& x);
ZFraction operator*(const ZFraction& x) const;
ZFraction& operator*=(const ZFraction& x) const;
2016-03-05 22:37:08 +00:00
private:
2016-03-06 16:29:02 +00:00
friend ostream& operator<<(ostream& o, const ZFraction& f);
int _a;
int _b;
2016-03-05 22:37:08 +00:00
};
#include "ZFraction.cpp"
#endif