1 2 3 4 5 6 7 8 9 10 11 12 13 14
| double Crypter(double message,double clef){
double resultat=0.0;
cout << message<< endl ;
for (double i =7 ; i>=0 ; i--){
cout<< (int(message)>=int(pow(10.0,i)-1)) << " + "<<(int(clef)>=int(pow(10.0,i))) << " = " << ((int(int(message)-pow(10.0,i)) >= -1) != (int(int(clef)-pow(10.0,i)) >= -1)) << endl;
if ((int(int(message)-pow(10.0,i)) >= -1) != (int(int(clef)-pow(10.0,i)) >= -1))
resultat+=pow(10.0,i);
if (int(int(message)-pow(10.0,i)) >= -1)
message-= pow(10.0,i);
if (int(int(clef)-pow(10.0,i)) >= -1)
clef-= pow(10.0,i);
}
cout << endl;
return resultat; |