mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 5914_Richard.cpp
Thanks Richard !
This commit is contained in:
parent
ace04bc5e1
commit
27d14fa7c3
27
HDOJ/5914_Richard.cpp
Normal file
27
HDOJ/5914_Richard.cpp
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user