测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A52076. 运行下列程序,若输入: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;…

单选题 容易

题目描述

运行下列程序,若输入: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;
}

选项(单选)

上一题 下一题