![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/e98e2305ccba9783bbd78f4384edd7e6.png)
思路:
直接按题目要求递推即可
c
o
d
e
code
code
#include<iostream>
#include<cstdio>
using namespace std;
int n, f[1000010];
int main()
{
for(int i=1000000; i>=1; i--)
{
if(i<=100)
f[i]=f[f[i+11]];
else f[i]=i-10;
}
scanf("%d", &n);
while(n!=0)
{
printf("%d\n", f[n]);
scanf("%d", &n);
}
return 0;
}