这是我的代码
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int n=0;
do
printf("Height of Pyramid:\n");
n = GetInt();
while (n>=0);
printf("you picked %i", n);
}
这是我的错误
mario.c:8:9: error: expected 'while' in do/while loop n = GetInt(); ^ mario.c:6:5: note: to match this 'do' do ^
最佳答案
您忘记包含大括号 {...}
。替换为:
do {
printf("Height of Pyramid:\n");
n = GetInt();
} while (n>=0);
关于c - 我在 do/while 循环中有一段时间,但它仍然告诉我我没有,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25171936/