Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class BiggestOfThree {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double a = Double.parseDouble(scanner.nextLine());
- double b = Double.parseDouble(scanner.nextLine());
- double c = Double.parseDouble(scanner.nextLine());
- int counterA = (int) a;
- int counterB= (int) b;
- int counterC= (int) c;
- if (a >= -200 & a <= 200 & b >= -200 & b <= 200 & c >= -200 & c <= 200) {
- if (a >= b & a >= c) {
- if (a == counterA) {
- System.out.println(counterA);
- } else {
- System.out.printf("%.2f",a);
- }
- }
- else {
- if (b==counterB & c==counterC){
- System.out.println(Math.max(counterB,counterC));
- }
- else {
- System.out.println(Math.max(b, c));
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement