Solution for CCC '12 J2 - Sounds fishy! in Java 8


Nov. 6, 2019 2.077608 seconds Java 8
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        
                      Scanner in = new Scanner(System.in);
        int a  = in.nextInt();
        int b  = in.nextInt();
        int c  = in.nextInt();
        int d  = in.nextInt();
        
        if(a < b && b < c && c < d){
            System.out.println("Fish Rising");
        }else if(a > b && b > c && c > d){
            System.out.println("Fish Diving");
        }else if(a == b && b == c && c == d){
            System.out.println("Fish At Constant Depth");
        }else{
            System.out.println("No Fish");
        }
  
       

    }
}

Editorial


No editorial for this problem. :(

Original Problem


You can view the original page for this problem on the DMOJ.