单选题

运行下列程序,若输入:2↙,则输出结果是(  )。

#include<iostream>
#include<iomanip>
using namespace std;
int main() {
    float x,y;
    cin >>x;
    if(x<0.0) {
        y=0.0;
    } else if(x<10.0) {
        y=1.0/x;
    } else {
        y=1.0;
    }
    cout << y << endl;
    return 0;
}
A

0.0

B

1.00

C

0.5

D

0.50

赣ICP备20007335号-2