小编Luc*_*los的帖子

Python整数到字母等级问题

我试图解决这段代码中的错误:

import time

while1 = True

def grader (z):
    if   z >= 0 or z <= 59:
        return "F"
    elif z >= 60 or z <= 62:
        return "D-"
    elif z >= 62 or z <= 66:
        return "D"
    elif z >= 67 or z <= 69:
        return "D+"
    elif z >= 70 or z <= 62:
        return "C-"
    elif z >= 73 or z <= 76:
        return "C"
    elif z >= 77 or z <= 79:
        return "C+"   
    elif …
Run Code Online (Sandbox Code Playgroud)

python comparison if-statement

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

为什么循环在C++中执行此操作

好吧,初学者,放轻松.谢谢.

#include <iostream>
#include <windows.h>

using namespace std;
int main()
{

    int x = 0;
    bool while1 = true;
    while (while1)
    {
        cout << x << "\n";
        sleep(200);
        if (x < 10)
        {
            while1 = true;
        }
        else if (x >= 10)
        {
            while1 = false;
        }
        x = x+1;
    }
    cin.get();
}
Run Code Online (Sandbox Code Playgroud)

好吧,所以我不明白为什么程序甚至得到x到10如果我有if语句检查x <10之前我有1添加到x ...请解释.

c++

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

标签 统计

c++ ×1

comparison ×1

if-statement ×1

python ×1