Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test
- {
- Test() {
- super();
- }
- public static void main(String[] args) {
- System.out.println("Please enter values:");
- final Scanner in = new Scanner(System.in);
- double largest = Double.NEGATIVE_INFINITY;
- double smallest = Double.POSITIVE_INFINITY;
- while (true) {
- final double nextDouble = in.nextDouble();
- final double input = nextDouble;
- if (nextDouble != 0.0) {
- if (input > largest) {
- final double num = input;
- largest = num;
- if (num != input) {
- continue;
- }
- }
- if (input < smallest) {
- final double num2 = input;
- smallest = num2;
- if (num2 != input) {
- }
- }
- }
- else {
- if (largest != Double.NEGATIVE_INFINITY) {
- break;
- }
- final double num3 = 0.0;
- largest = num3;
- if (num3 != 0.0) {
- break;
- }
- final double num4 = 0.0;
- smallest = num4;
- if (num4 == 0.0) {
- break;
- }
- }
- }
- in.close();
- System.out.println(new StringBuilder().append("The smallest value was ").append(smallest).toString());
- System.out.println(new StringBuilder().append("The largest value was ").append(largest).toString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement