Guest User

Untitled

a guest
Nov 21st, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. # include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // x! = x * (x-1) * (x-2) * .. * 1
  6. // 5! = 5 * 4 * 3 * 2 * 1
  7. long factorial(int x){
  8.     // implementation.
  9.     for (int i = 1; i <= x; i++) {
  10.         cout <<
  11.         // gera eitthvað við i
  12.     }
  13. }
  14.  
  15. int pascal(int a, int b){
  16.     return factorial(a) / (factorial(b) * factorial(a - b));
  17. }
  18.  
  19. int main(){
  20.     cout << "Type in the number" << endl;
  21.     cin >> a;
  22.  
  23.     // implementation
  24. }
Add Comment
Please, Sign In to add comment