URI 1037 Interval Solution in C++
URI 1037 👀 Interval 👀Solution in C++
Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.URI 1037 👀 Interval 👀Solution in C++
#include <iostream>using namespace std;
int main(){
float 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(n > 25 && n <= 50){
cout << "Intervalo (25,50]" << endl;
}else if(n > 50 && n <= 75){
cout << "Intervalo (50,75]" << endl;
}else{
cout << "Intervalo (75,100]" << endl;
}
}
return 0;}
No comments