hdu 2516解題報告

來源:互聯網
上載者:User

#include<iostream>
using namespace std;
int main()
{
    int n,i,k;
    long long int a[66]={3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,17711,28657,
    46368,75025,121393,196418,317811,514229,832040,1346269,2178309,3524578,5702887,9227465,14930352,
    24157817,39088169,63245986,102334155,165580141,267914296,433494437,701408733,1134903170,1836311903,
    512559680,1776683621,368225352,2144908973,363076002,1820529360,764848393,1640636603,695895453,
    1073992269,885444751,696897233,1582341984,1845853122,1412467027,375819880,2118290601,887448560,
    511172301,1642909629,572466946,708252800,1445263496};
    while(cin>>n,n)
    {
    for(i=0;i<66;i++)
    {
    if(n==a[i])
    {k=1; break;}
    else
    k=0;
    }
    if(k==1)
    cout<<"Second win"<<endl;
    else
    cout<<"First win"<<endl;
    }
    return 0;
}
/*
#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
    int i,j,a[100],k=0;
    for(i=1;i<100;i++)
    {
    a[0]=1;
    a[1]=2;
    a[i+1]=a[i]+a[i-1];
    }
    for(j=1;j<100;j++)
    {
    if(a[j+1]<2147483648)
    {k++;
    cout<<a[j+1]<<",";//<<k<<endl;
    }
    }
    system("pause");
    return 0;
}
算出數組的數目以及值 也就是必敗點的值
*/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.