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;
}选项(单选)
答案解析
详细答案解析为会员权益,按每日次数查看。
开通 / 升级会员
上一题
下一题