"expected ';' after expression
とexpressions result unused
というエラーが発生するのはなぜですか?ここに私のコードは次のとおりです。エラー:予期した ';'式と結果が未使用の後
#include <cs50.h>
#include <stdio.h>
int main(void)
{
printf("How tall do you want your pyramid to be?\n");
int height = GetInt();
if (height > 23 && height < 1)
{
printf("Please use a positive number no greater than 23:\n");
}
else (height > 0 && height <= 23)
{
printf("Thanks!\n");
}
}
「else」ではなく「else if」が必要です。 '(height> 0 && height <= 23)'を削除してください。 'height> 23 && height < 1' -->' height> 23 ||高さ<1 " – BLUEPIXY
@BLUEPIXY:答えとして投稿してみませんか? –
@RudyVelthuisこれはタイプミスです。 – BLUEPIXY