C++ 代码
#include<iostream>
using namespace std;
int main()
{
float p;
cin >> p;
if(p >= 0 && p <= 25)
{
cout << "Intervalo [0,25]" << endl;
}
else if(p > 25 && p <= 50)
{
cout << "Intervalo (25,50]" << endl;
}
else if(p > 50 && p <= 75)
{
cout << "Intervalo (50,75]" << endl;
}
else if(p > 75 && p <= 100)
{
cout << "Intervalo (75,100]" << endl;
}
else
{
cout << "Fora de intervalo" <<endl;
}
}