Source Code
#include <iostream>
#include <math.h>
using namespace std;

void printdashendl()
{
	cout << "-" << endl;
}

void printdash()
{
	cout << "-";
}

void loop(int n) {
	if (n <= 1)
		return;

	loop(n - 1);

	for (int x = 0; x < n- 1; x++)
		printdash();

	printdashendl();
	printdashendl();

	loop(n - 1);
}


int main() {
	int n, b;
	cin >> n >> b;

	for (int i = 0; i <= n; i++) {
		for (int j = 0; j < b; j++)
			cout << "-";

		cout << i << endl;

		

		if (i != n) {
			printdashendl();
			loop(b - 1);
		}
	}
}
Copy
Ruler Qusay
GNU G++17
3 ms
884 KB
Wrong Answer