36 lines
585 B
C++
36 lines
585 B
C++
#ifndef DEF_DUREE
|
|
|
|
#define DEF_DUREE
|
|
#include <iostream>
|
|
#include <string>
|
|
using namespace std;
|
|
|
|
class Duree{
|
|
public:
|
|
Duree(int h=0, int m=0, int s=0);
|
|
Duree(const Duree& d);
|
|
|
|
bool operator==(const Duree& x);
|
|
void operator+=(const Duree& d);
|
|
void operator*=(const int d);
|
|
|
|
private:
|
|
int _h;
|
|
int _m;
|
|
int _s;
|
|
void fix();
|
|
friend ostream& operator<<(ostream& o, const Duree& d);
|
|
|
|
};
|
|
|
|
|
|
// Operateurs binaires
|
|
Duree operator+(Duree& l, Duree& r);
|
|
Duree operator*(int l, Duree& r);
|
|
Duree operator*(Duree& l, int r);
|
|
|
|
|
|
|
|
#include "Duree.cpp"
|
|
|
|
#endif |