Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. long long c[107][107];
  5. long long a,b,i,w;
  6. int main()
  7. {
  8. cin >>a>>b;
  9. for(i=1;i<=a;i++){
  10. for(w=1;w<=b;w++)
  11. if(i==1 || w==1) c[i][w]=1;
  12. else c[i][w] = c[i-1][w]+a[i][w-1];
  13. }
  14. for(i=1; i<=a;i++){
  15. for(w=1;w<=b;w++)
  16. cout << c[i][w]<<" ";
  17. cout << " " <<endl;
  18. }
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement