• 2022-06-29
    ‌对若干个正数求和,输入“ok”结束,下面正确的代码是( )。‍‌知识点:while循环。‍
    A: s = 0x = input()while x!="ok": s += int(x) print(s)
    B: s = 0while True: x = input() if x=="ok": break s += int(x) print(s)
    C: s = 0x = input()while x!="ok": s += int(x) x = input()print(s)
    D: s = 0while x!="ok": x = input() s += int(x) print(s)