| 比赛 | 20120807 | 评测结果 | AAAAAAAAAA | 
    | 题目名称 | 古代人的难题 | 最终得分 | 100 | 
    | 用户昵称 | TBK | 运行时间 | 0.003 s | 
    | 代码语言 | C++ | 内存使用 | 0.31 MiB | 
    | 提交时间 | 2012-08-07 09:11:33 | 
显示代码纯文本
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
long long a[92],b,c;
int main(void)
{
	freopen("puz.in","r",stdin);
	freopen("puz.out","w",stdout);
	cin>>b;
	a[0]=1;
	a[1]=1;
	for (c=2;c<92;c++) 
	{
		a[c]=a[c-1]+a[c-2];
		if (a[c]>b) 
		{
			cout<<a[c-1]<<" "<<a[c-2];
			break;
		}
	}
	fclose(stdin);
	fclose(stdout);
	return 0;
}