【发布时间】:2020-12-07 19:40:06
【问题描述】:
我目前正在做 CS50 计算机科学导论: 我开始了这段代码(用 C 编写),我必须根据用户编写的内容编写金字塔。
这是我的代码:
#include <stdio.h>
#include <cs50.h>
int main(void);
int n;
do
{
n = get_int("Positive Number: \n");
}
while (n > 0 || n < 9);
这是我的终端显示的错误:
mario.c:6:1: error: expected identifier or '(' do ^ mario.c:10:1: error: expected identifier or '(' while (n > 0 || n < 9); ^ 2 errors generated. <builtin>: recipe for target 'mario' failed make: *** [mario] Error 1
有人可以帮忙吗? 威廉
【问题讨论】:
-
与您的问题无关,但请仔细查看您的条件
n > 0 || n < 9。提示:此条件始终为真。
标签: c main do-while cs50 function-definition