Last active
November 5, 2019 08:52
-
-
Save pinglunliao/7776f894ab74366f9cff to your computer and use it in GitHub Desktop.
c002: 10696 - f91 FYI: https://yunlinsong.blogspot.com/2015/05/c002-10696-f91.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
long f91(int n) | |
{ | |
if( n >= 101 ) | |
return n - 10; | |
else | |
return 91; | |
} | |
int main() | |
{ | |
int n; | |
while( cin >> n ) | |
{ | |
if( n == 0 ) | |
break; | |
long result = f91(n); | |
cout << "f91(" << n << ") = " << result << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment