![cs50 mario problem](https://i0.wp.com/hostcosec.shop/wp-content/uploads/2022/08/1.jpg?resize=1200%2C675&ssl=1)
![cs50 mario problem](https://i0.wp.com/hostcosec.shop/wp-content/uploads/2022/08/2.jpg?resize=1200%2C675&ssl=1)
Reply
#include <cs50.h>
#include <stdio.h>
int main(void)
{
for (int j=0; j<5; j++)
{
for (int i=0; i<5; i++)
{
printf(“#”);
}
printf(“\n”);
}
}
Removing hardcoding to 5
Instead of predetermined 5 bricks, why not ask user to enter no. of bricks.
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int t = get_int(“no. of bricks “);
for (int j=0; j<t; j++)
{
for (int i=0; i<t; i++)
{
printf(“#”);
}
printf(“\n”);
}
}
![Mario cs50](https://i0.wp.com/hostcosec.shop/wp-content/uploads/2022/08/Untitled-design-4.jpg?resize=1200%2C675&ssl=1)
[learn_press_profile]