1037 - Interval - URI Online Judge || URI Online Judge 1037 Interval Solution

Problem name: 1037 - Interval
Judge: URI Online Judge
Problem link: 1037 - Interval
Solution on GitHub: 1037 - Interval


URI Online Judge 1037 - Interval Solution in C++/Cpp

#include <iostream>
using namespace std;

int main()
{
    float n;
    cin >> n;
    if (n > 100 || n < 0)
    {
        cout << "Fora de intervalo" << endl;
    }
    else
    {
        if (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;
}




Next Post Previous Post
No Comment
Add Comment
comment url