[ create a new paste ] login | about

Link: http://codepad.org/rQV2hRhg    [ raw code | output | fork ]

C, pasted on Jun 3:
#include <iostream>

template <int N> class Fibonacci {
public:
static const int value = Fibonacci<N - 1>::value + Fibonacci<N - 2>::value;
};

template <> class Fibonacci<0> {
public:
  static const int value = 0;
};

template <> class Fibonacci<1> {
public:
  static const int value = 1;
};

int main() {
  std::cout << Fibonacci<10>::value << std::endl;
  return 0;
}
/* end */


Output:
1
2
3
4
5
6
Line 19: error: iostream: No such file or directory
Line 3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
Line 8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
Line 13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
In function 'main':
Line 19: error: expected expression before ':' token


Create a new paste based on this one


Comments: