C 语言 用while loop 停不下来了

1个回答

  • /*Do you like The Big Bang Theory (1-yes, 2- no):1Do you like The Big Bang Theory (1-yes, 2- no):1Do you like The Big Bang Theory (1-yes, 2- no):1Do you like The Big Bang Theory (1-yes, 2- no):2Do you like The Big Bang Theory (1-yes, 2- no):3INVALID selection.Do you like The Big Bang Theory (1-yes, 2- no):qscore = 135Press any key to continue*/#include

    int main() {

    int an,score = 0;

    while(printf("Do you like The Big Bang Theory (1-yes, 2- no):"),

    scanf("%d",&an) == 1) {

    if(an == 1) score += 60;

    else if(an == 2) score -= 45;

    else printf("INVALID selection.n");

    }

    printf("score = %dn",score);

    return 0;

    }