Department of Computer Science | Institute of Theoretical Computer Science | CADMO

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Program: power8_exact.cpp // Raise a number to the eighth power, // using integers of arbitrary size #include #include int main() { // input std::cout << "Compute a^8 for a =? "; ifm::integer a; std::cin >> a; // computation ifm::integer b = a * a; // b = a^2 b = b * b; // b = a^4 // output b * b, i.e., a^8 std::cout << a << "^8 = " << b * b << ".\n"; return 0; }