小编Ban*_*rew的帖子

我的while语句是无限循环?

#include "stdafx.h"
#include <iostream>
#include <string>

#include <stdio.h>
#include <stdlib.h>
#include <time.h>



using namespace std;

//this program will let the user input their assignment score and see their letter grade
int main() {

    int score;

    cout << "Input your score: ";

    //to make the while loop
    int x = 1;

    while (x == 1) {

        cin >> score;

        if (score >= 90){
            cout << "\nA";
            break;
        }

        else if (score >= 80) {
            cout << "\nB";
            break;
        }

        else if …
Run Code Online (Sandbox Code Playgroud)

c++ while-loop

-4
推荐指数
1
解决办法
798
查看次数

标签 统计

c++ ×1

while-loop ×1