using uint64 = unsigned long long;
class Uint2048 {
public:
Uint2048();
Uint2048(int x);
bool operator<(Uint2048 other);
Uint2048 operator+(Uint2048 other);
void Print();
private:
uint64 u_[32];
};
Vérifiez avec:
rm 1.tar.gz; wget --no-cache http://fabien.viger.free.fr/cpp/td6/1.tar.gz tar xf 1.tar.gz make 1.1RENDU: 1.1.cc
Uint2048 result(0);
Uint2048 one(1);
Uint2048 counter(0);
while (counter < a) {
result = result + b;
counter = counter + one;
}
return result;
Test: make 1.6
5,6,7 8,9,10 11,12,13en remplaçant, bien sûr, les valeurs des entiers!
rm 2.1.test.sh; wget --no-cache http://fabien.viger.free.fr/cpp/td6/2.1.test.sh bash 2.1.test.sh