Answer the question
In order to leave comments, you need to log in
Can I somehow do without initializing the variable?
Can I somehow do without initializing the n variable?
#include<iostream>
#include<cstdlib>
using namespace std;
int main() {
system("chcp 1251>nul");
int n;
cout << "n " << n;
cin >> n;
int k = 1;
while (k < n) {
k = k * (n - k) / (k + 1);
cout << " " << k++;
k++;
}
cout << endl;
system("pause");
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question