#557. NOIP2011TG-24

NOIP2011TG-24

  1. (阅读程序写结果)
#include<iostream>
using namespace std;

int n;

void f2(int x,int y);

void f1(int x,int y)
{
  if(x<n)
    f2(y,x+y);
}

void f2(int x,int y)
{
  cout<<x<<' ';
  f1(y,x+y);
}

int main()
{
  cin>>n;
  f1(0,1);
  return 0;
}

输入:30

输出:{{ input(1) }}