My issue
i need solution i think i am facing with space
My code
#include <iostream>
using namespace std;
void printRhombusCompliment(int N) {
// Upper part of the rhombus
for (int i = N; i >= 1; i--) {
for (int j = 1; j <= i; j++) {
cout << "*";
}
for (int j = 1; j <= 2 * (N - i); j++) {
cout << " ";
}
for (int j = 1; j <= i; j++) {
cout << "*";
}
cout << endl;
}
// Lower part of the rhombus
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= i; j++) {
cout << "*";
}
for (int j = 1; j <= 2 * (N - i); j++) {
cout << "";
}
for (int j = 1; j <= i; j++) {
cout << "*";
}
cout << endl;
}
}
int main() {
int N;
cin >> N;
printRhombusCompliment(N);
return 0;
}
Learning course: Learn Programming and Problem Solving using C++
Problem Link: https://www.codechef.com/learn/course/sit-cpp-fall/SITFALL64/problems/CPPFALL465