Advertisement
zaidhuda

E

Sep 15th, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include "iostream"
  2. #include "utility"
  3. #include "algorithm"
  4. #include "set"
  5. #include "vector"
  6. #include "map"
  7. #include "iterator"
  8. #include "functional"
  9. #include "sstream"
  10. #include "iomanip"
  11. #include "deque"
  12. #include "stack"
  13. #include "cstring"
  14.  
  15. #define ll long long
  16. #define REP(i,n) for(ll i=0;i<n;i++)
  17. #define IREP(in,i,n) for(ll i=in;i<n;i++)
  18.  
  19. #define dbg(msg) //cout << msg << endl;
  20. #define var(n,x) //cout << n << " = " << x << endl;
  21.  
  22. using namespace std;
  23.  
  24. int f91(int n){
  25. if(n<101){
  26. return f91(f91(n+11));
  27. }
  28. if(n>100){
  29. return n-10;
  30. }
  31. }
  32.  
  33. int main(int argv, char** argc){
  34.  
  35. int n;
  36. while(cin >> n){
  37. if(!n) break;
  38. cout << "f91(" << n << ") = " << f91(n) << endl;
  39. }
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement