以下是错误:
mario.c:23:25: error: expected identifier or ‘(’ before ‘int’
for (int levelCounter, int usrHeight, int paddIt = usrHeight - 1, char hashMaker, int hashCounter;(levelCounter <= usrHeight);)
^
mario.c:25:39: error: expected ‘)’ before ‘paddIt’
printf("%'' * paddIt %c*hashCounter"paddIt,hashMaker,hashCounter);
^
^ 标识编译器说错误发生的位置。
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int usrHeight = 0;
int levelCounter = 0;
int paddIt = 0;
int hashCounter = 2;
char hashMaker = "#";
do
{
printf("How high?\n");
int usrHeight = GetInt();
}
while ( usrHeight > 23 || usrHeight < 0);
if ( usrHeight >= 0 && usrHeight <= 23);
{
printf("constructing...\n");
}
for (int levelCounter, int usrHeight, int paddIt = usrHeight - 1, char hashMaker, int hashCounter;(levelCounter <= usrHeight);)
*^ This is where the first error is occuring*
{
printf("%'' * paddIt %c*hashCounter"paddIt,hashMaker,hashCounter);
*^ And here is where the second is*
paddIt = paddIt - 1;
levelCounter = levelCounter + 1;
hashCounter = hashCounter + 1;
}
}
我到底在做什么是错的?