Quick actions

cmd+k|ctrl+k

Navigation

Languages

recursiya

Snippet info

Language

Cpp

Visibility

public

Author

skezze

Created

2019-11-11T18:15:23Z

Updated

2019-12-13T11:32:47Z

#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;
}
INFO