another X loop

PHOTO EMBED

Sun Oct 25 2020 03:45:41 GMT+0000 (UTC)

Saved by @mahmoud hussein #c++

#include <iostream>
#include<cmath>
#include<ctime>
#include<string>
#include <iomanip>
#include <fstream>

using namespace std;

int main()
{
	int number;
	cin >> number;
	for (int i = 0; i <=number; i++)
	{
		for (int j = 0; j <= number; j++)
		{
			if
				(
					i == 0 || i == number ||
					i == number/2|| j == number/2||
					j == 0 || j == number ||
					i == j || j == (number - i + 0)
					)
				cout <<" "<< "*";
			else
				cout << "  ";
			int h = (number - i + 1);
		}
	
			cout << "\n";
	}
		


		
	


}

	
	

	
	

content_copyCOPY

http://cpp.sh/