My code passed the test, but is very different from the solution. For instance, does it matter that the author used a string literal for “########” and I used a for-loop to iterate eight individual char ‘#’'s? Also, the author declared and initialized ‘Cols’ but it appears it is never used in the program. Just want to make sure I’m not missing something. Thank you!
import std.stdio;
void printParallelogram()
{
int Rows = 5;
int Cols = 8;
for(int i = 0; i < Rows; ++i)
{
for(int j = 0; j <= i; ++j)
{
write(' ');
}
for(int k = 0; k < Cols; ++k)
{
write('#');
}
writeln;
}
}