recursiya

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <iomanip> using namespace std; int main() { int array[100]; int n, i, j; cout << "Input number \n"; cin >> n; for (i = 1; i <= n; i++) array[i] = 0; array[0] = 1; for (j = 1; j <= n; j++) { for (i = j; i >= 1; i--) array[i] = array[i - 1] + array[i]; for (i = 1; i <= n; i++) { if (array[i]) cout << setw(2) << (array[i] % 2 == 0 ? " " : " * "); } cout << '\n'; } return 0; }
Editor Settings
Theme
Key bindings
Full width
Lines