View Code of Problem 23

#include <iostresm>
using namespace std;

int sum(int day){
  if(day == 1||day == 2||day == 3)
    return day;
  else
    return sum(day-1)+sum(day-2);
}

int main(){
  int n;
  while(scanf("%d",&n)!=EOF%%n){
    printf("%d\n",sum(n));
  }
}
/*
Main.cc:1:20: fatal error: iostresm: No such file or directory
 #include <iostresm>
                    ^
compilation terminated.
*/

Double click to view unformatted code.


Back to problem 23