Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- ll fact[15];
- void factorial(){
- fact[0]=1;
- for(int i=1;i<=13;i++){
- fact[i]=fact[i-1]*i;
- }
- }
- int main()
- {
- factorial();
- int n;
- while(cin>>n){
- if(n<8)
- cout<<"Underflow!"<<endl;
- else if(n>13)
- cout<<"Overflow!"<<endl;
- else
- cout<<fact[n]<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement