Kombinační čísla

#include <iostream>
using namespace std;
 
int c[10][10];
 
int main ()
{
    c[0][0] = 1;
    for (int n = 1; n <= 9; n++)
    {
        c[n][0] = 1;
        for (int k = 1; k <= n; k++)
            c[n][k] = c[n-1][k - 1] + c[n-1][k];
    }
 
    for (int n = 0; n <= 9; n++)
    {
        for (int k = 0; k <= n; k++)
        {
            cout << c[n][k] << " ";
        }
        cout << endl;
    }
}
 
zpro/kombinacni_cisla.txt · Last modified: 2022/02/03 17:36 by 88.103.111.44
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki