Pershendetje,
Programer shqiptar, ketu kam dy programe te vogla, i pari eshte ai ku paraqet "Serin e Fibonacci-t" dhe tjetri "Trekendshin e Paskalit"...
Tani desha qe ta komentojm se bashku, po kerkoj ndihmen tuaj qe kodi i me poshtem te komentohet me gjeresisht...
Dhe tjetra eshte ajo qe po kerkoj ndihme per "Permutations & Combinations" nga ana e cpp... per sqarime se cfare jane permutacionet dhe kombinacionet e keni te bashkangjitur nje doc...
Ju faliminderit!
Pra ne matematik seria e Fibonacci-t eshte keshtu, pra mbledhja e numrave te nje-pasnjeshem...
Kodi:
#include
using namespace std;
int main(void)
{
int f0 = 0, f1 = 1, fn, repeat_times;
cout << "Enter number of elements (the first two elements are always displayed): ";
cin >> repeat_times;
cout << endl << "Fibonacci series: 0 1 ";
for(int i = 0; i < repeat_times; i++)
{
fn = f0 + f1, f0 = f1, f1 = fn;
cout << fn << " ";
}
cout << endl;
return 0;
}
Kjo eshte ajo qe do te shfaqet pas ekzekutimit te programit te mesiperm...
Kodi:
#include
using namespace std;
int fact(int);
main()
{
int rows,i,j,k;
cout<<"Enter the number of rows you want in the triangle:";
cin>>rows;
for(i=0;i
Krijoni Kontakt