UVA Solution 369 - Combinations - Solution in C, C++ | Volume 3
UVA Online Judge Solution 369 - Combinations| Volume 3
UVA Problem Link - https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=5&page=show_problem&problem=305
Problem Name: 369 - Combinations
Problem Number : UVA - 369 - Combinations
Online Judge : UVA Online Judge Solution
Volume: 3
Solution Language : C, C plus plus
UVA Solution 369 - Combinations Code in C, CPP:
#include<stdio.h> int main() { int N, M, i, j; long long int PASCAL[101][101] = {0}; PASCAL[1][0] = PASCAL[1][1] = 1; for(i = 2; i <= 100; i++) { PASCAL[i][0] = 1; for(j = 1; j < i; j++) PASCAL[i][j] = PASCAL[i-1][j] + PASCAL[i-1][j-1]; PASCAL[i][i] = 1; } while(scanf("%d %d", &N, &M) == 2) { if(N == 0 && M == 0) break; printf("%d things taken %d at a time is %lld exactly.\n", N, M, PASCAL[N][M]); } return 0; }
No comments:
Post a Comment