AcWing 659. 區間

nighty_k 2022-01-07 20:01:21 阅读数:706

acwing

鏈接
https://www.acwing.com/problem/content/661/

思路
選擇判斷

#include <iostream>
using namespace std;
int main()
{

double x;
cin >> x;
if (x >= 0 && x <= 25) cout << "Intervalo [0,25]" << endl;
else if (x > 25 && x <= 50) cout << "Intervalo (25,50]" << endl;
else if (x > 50 && x <= 75) cout << "Intervalo (50,75]" << endl;
else if (x > 75 && x <= 100) cout << "Intervalo (75,100]" << endl;
else cout << "Fora de intervalo" << endl;
return 0;
}
版权声明:本文为[nighty_k]所创,转载请带上原文链接,感谢。 https://gsmany.com/2022/01/202201072001206608.html