#include <iostream>
using namespace std;
int main() {
int n;
// First do while loop
// Input size
do {
cout << "Enter the size of the diamond (positive integer): ";
cin >> n;
} while (n <= 0);
int spaces = n - 1, stars = 1;
// Second do while loop
//Upper half of the diamond
do {
// Print spaces
int i = 0;
do {
cout << " ";
i++;
} while (i < spaces);
// Print stars
int j = 0;
do {
cout << "*";
j++;
} while (j < stars);
cout << endl;
spaces--;
stars += 2;
} while (spaces >= 0);
spaces = 1, stars = 2 * n - 3;
// Third do while loop
// Lower half of the diamond
do {
// Print spaces
int i = 0;
do {
cout << " ";
i++;
} while (i < spaces);
// Print stars
int j = 0;
do {
cout << "*";
j++;
} while (j < stars);
cout << endl;
spaces++;
stars -= 2;
} while (stars > 0);
return 0;
}