1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#include<iostream>
using namespace std;
class Projet{
int Di;
int Xmax;
int Xmin;
int Smin;
int Smax;
int Sinit;
int L;
int M;
int N;
public:
Projet(int, int, int, int, int, int, int, int, int);
void comparaison(int,int ,int ,int);
friend ostream & operator<<(ostream &,Projet);
};
Projet::Projet(int di, int xmax, int xmin, int smin, int smax, int sinit,int l, int m=0, int n=0){
Di = di;
Xmax = xmax;
Xmin = xmin;
Smin = smin;
Smax = smax;
Sinit = sinit;
L=l;
M=m;
N=n;
}
void Projet::comparaison(int di,int l, int xmax, int xmin){
M = di+l-xmax;
N = di+l-xmin;
if(N < Sinit)
cout<<"N"<<N<<endl;
else
cout<<"Sinit"<<Sinit<<endl;
if(M > Sinit)
cout<<"M"<<M<<endl;
else
cout<<"Sinit"<<Sinit<<endl;
}
ostream & operator<<(ostream & out,Projet P){
out<<P.M<<"!!!"<<P.N<<":::"<<endl;
return out;
}
main(){
Projet P(9,16,10,3,6,3,3);
cout<<M<<endl;
cout<<N<<endl;
system("pause");
} |
Partager