小编Wil*_*iam的帖子

预期标识符(在 C 中)

我目前正在做计算机科学的 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);
Run Code Online (Sandbox Code Playgroud)

这是我的终端显示的错误:

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
Run Code Online (Sandbox Code Playgroud)

有人可以帮忙吗?威廉

c program-entry-point do-while function-definition cs50

0
推荐指数
1
解决办法
109
查看次数