#include<bits/stdc++.h>
#define ll long long
using namespace std;
int cnt=0;
bool check(int x,int cnt)
{
if(cnt==5)
{
if(x>1000)
return true;
else
return false;
}
if((x+1)%5!=0)
return false;
else
{
int tmp=x+1-(x+1)/5;
return check(tmp,cnt+1);
}
}
int main()
{
for(int i=1000; i<100000; i++)
{
if(check(i,0))
{
cout<<i<<endl;
break;
}
}
return 0;
}
第五届蓝桥杯(国赛)——海盗分金币(递归写法)
最新推荐文章于 2022-03-15 10:19:48 发布