1186 F函数

来源:互联网 发布:淘宝标签卖家 编辑:程序博客网 时间:2024/06/11 18:46
#include <bits/stdc++.h>using namespace std;int f (int n){        if (n >= 101)                return n - 10;        else                return f (f (n + 11));}int main (){        int x;        for (; ; ){                cin >> x;                if (x == 0)                        break;                else{                        cout << f (x) << endl;                }        }        return 0;}