#include #include ////////////////////////////////////////////////////// /// /// Usage: /// /// fib 10 /// /// Computes the 10th fibonacci number (with a slow algorithm!). /// Works for numbers other than 10 too. /// /// Below demonstrates how to use the call_graph facility, /// See include/call_graph.h and bin/show_call_graph for more info. /// ////////////////////////////////////////////////////// #define call_graph_file "fib_call_graph" #include "call_graph.h" using std::cout; int fib(int n) { call_decl("fib", n); if (n <= 1) return call_return(n); else return call_return(fib(n-1) + fib(n-2)); } int main(int argc, char *argv[]) { int n = 5; if (argc > 1) n = atoi(argv[1]); cout << "fib(" << n << ") = " <