此行的错误消息

时间:2012-03-29 01:05:50

标签: c++

为什么我收到此错误消息?

Error: expected a ';'

从:

int main()
{
    int score;
    double distance;
    char playAgain;
    bool shieldsUp;

    short lives;
    short aliensKilled;

    score = 0
    distance = 1200.76;
    playAgain = 'y';
    shieldsUp = true;
    lives = 3
    aliensKilled = 10;

错误位于distance = 1200.76;aliensKilled = 10;

之下

2 个答案:

答案 0 :(得分:1)

你有:

score = 0

你想:

score = 0;

类似于lives = 3

答案 1 :(得分:1)

你真的忘记了一些事情:

...
score = 0;
...
lives = 3;
...