Advertisement
Guest User

Untitled

a guest
Aug 30th, 2011
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int f91(int theinput);
  5.  
  6. int main()
  7. {
  8. int input;
  9. int output;
  10. while(cin>>input)
  11. {
  12. if(input!=0)
  13. {
  14. output = f91(input);
  15. cout<<"f91("<<input<<") = "<<output<<endl;
  16. }
  17. else
  18. break;
  19. }
  20.  
  21. return 0;
  22. }
  23.  
  24. int f91(int theinput)
  25. {
  26. if(theinput>=101)
  27. return theinput-10;
  28. else
  29. return f91(f91(theinput+11));
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement