Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. long double fat(int n){
  2.     long double f = 1;
  3.     for(int i=2; i<=n; i++)
  4.         f *= i;
  5.     return f;
  6. }
  7.  
  8. int main(){
  9.  
  10.     int n, q;
  11.     long double t;
  12.      
  13.     while(cin>>n>>q && n+q){
  14.         cin>>t;
  15.         long double ans = fat(n-q+1);
  16.         if(ans <= t) cout<<ans<<"\n";
  17.         else printf("descartado\n");
  18.     }
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement