#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#include<limits>
#include<cmath>
#include<queue>
#include<map>
using namespace std;
#define LLU long long unsigned int
#define LLD long long double
#define FOR(i,N) for(int i=0;i<(N);i++)
int main()
{
long long n;
vector<LLU> fib;
fib.push_back(1);
fib.push_back(1);
for(int i = 2; i < 14; i++)
{
fib.push_back(fib[i-1] * i);
}
while(scanf(“%lld”, &n)!=EOF)
{
if(n < 0)
{
if( n / 2 * 2 == n)
printf(“Underflow!\n”);
else
printf(“Overflow!\n”);
}
else if(n<8)
{
cout<<”Underflow!\n”;
}
else if(n>13)
{
cout<<”Overflow!\n”;
}
else
{
cout<<fib[n]<<endl;
}
}
}
No comments:
Post a Comment