注意:浮点型和整型、字符型都能够直接比较大小
#include <iostream>
using namespace std;
int main ()
{
double n;
cin >> n;
if (n < 0 || n > 100) cout << "Fora de intervalo" << endl;
else if (n >= 0 && n <= 25) cout << "Intervalo [0,25]" << endl;
else if (25 < n && n <= 50) cout << "Intervalo (25,50]" << endl;
else if (50 < n && n <= 75) cout << "Intervalo (50,75]" << endl;
else cout << "Intervalo (75,100]" << endl;
return 0;
}