I've got this code for the Mario assignement in pset1. It prints out OK in the shell, but check50 rejects it. Can anybody help me?
#include <stdio.h>
#include <cs50.h>
int main(void)
{
// initialize variables
int x, y,z;
// Request to the user to enter a value
do
{
printf("Please give me an integer between 1 and 23. ");
x = GetInt();
}
// check if the value is in range
while (x <=0 ||x>23);
y = x -1;
z = 1;
for (int i =x; x>0; i--)
{
for (int i = 0;i < x;i++)
{
// this prints the spaces
printf(" ");
}
for (int i = 1; i <= z; i++)
{
//this prints the #
printf("#");
}
// this causes the line break
printf("\n");
// adjustment of variables
x--;
z++;
}
return 0;
}