【Codeforces Round #459 (Div. 2) A】Eleven

【链接】 我是链接,点我呀:)
【题意】

在这里输入题意

【题解】

这个数列增长很快的。 直接暴力模拟看看是不是它的一项就好了

【代码】

#include <bits/stdc++.h>
using namespace std;

int n;

bool ff(int x){
    if (x==1) return true;
    int a = 1,b = 1,c=a+b;
    while (c<=x){
        if (c==x){
            return 1;
        }
        a = b,b = c;
        c = a+b;
    }
    return 0;
}

int main(){
	#ifdef LOCAL_DEFINE
	    freopen("rush_in.txt", "r", stdin);
	#endif
	ios::sync_with_stdio(0),cin.tie(0);
	cin >> n;
	for (int i = 1;i <= n;i++)
        if (ff(i))
            cout<<"O";
        else

            cout<<"o";
	return 0;
}
原文地址:https://www.cnblogs.com/AWCXV/p/8384129.html