Create 5914_Richard.cpp

Thanks Richard !
This commit is contained in:
Kirigaya Kazuto 2016-10-15 17:20:05 +08:00 committed by GitHub
parent ace04bc5e1
commit 27d14fa7c3

27
HDOJ/5914_Richard.cpp Normal file
View File

@ -0,0 +1,27 @@
#include <iostream>
using namespace std;
int fbnq[20]={1,2,3,5,8,13,21};
bool remain[21]={0};
void init()
{
for(int i=0;i<7;i++)
remain[fbnq[i]]=true;
}
int main()
{
int t;
cin>>t;
for(int i=1;i<=t;i++)
{
init();
cout<<"Case #"<<i<<": ";
int n;
cin>>n;
int sum=0;
for(int i=1;i<=n;i++)
{
if(remain[i]==true)sum++;
}
cout<<n-sum<<endl;
}
}