Skip to content

Instantly share code, notes, and snippets.

@folivetti
Created February 17, 2017 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save folivetti/07750bf49178184df25b939525d8c851 to your computer and use it in GitHub Desktop.
Save folivetti/07750bf49178184df25b939525d8c851 to your computer and use it in GitHub Desktop.
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
double x;
Scanner sc = new Scanner(System.in);
x = sc.nextDouble();
if (x >= 0 && x <= 25) {
System.out.println("Intervalo [0,25]");
} else if (x > 25 && x <= 50) {
System.out.println("Intervalo (25,50]");
} else if (x > 50 && x <= 75) {
System.out.println("Intervalo (50,75]");
} else if (x > 75 && x <= 100) {
System.out.println("Intervalo (75,100]");
} else {
System.out.println("Fora de intervalo");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment