UVA 10696 : https://uva.onlinejudge.org/external/106/10696.pdf
/*recurrsion math*/
#include<iostream>
#include<cstring>
using namespace std;
int n=0,ans=0;
int main(void) {
while (cin >> n)
{
if (n == 0)break;
//regular
if (n <= 101) ans = 91;
else ans = n - 10;
cout <<"f91("<<n<<") = "<< ans << endl;
}
system("PAUSE");
}
/*recurrsion math*/
#include<iostream>
#include<cstring>
using namespace std;
int n=0,ans=0;
int main(void) {
while (cin >> n)
{
if (n == 0)break;
//regular
if (n <= 101) ans = 91;
else ans = n - 10;
cout <<"f91("<<n<<") = "<< ans << endl;
}
system("PAUSE");
}
留言
張貼留言