Advertisement
Azazavr

javarush.test.level06.lesson11.bonus01

Nov 2nd, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. package com.javarush.test.level06.lesson11.bonus01;
  2.  
  3. /* Нужно исправить программу, чтобы компилировалась и работала
  4. Задача: Программа вводит два числа с клавиатуры и выводит их максимум в виде «Max is 25»
  5. */
  6.  
  7. import java.io.BufferedReader;
  8. import java.io.IOException;
  9. import java.io.InputStreamReader;
  10.  
  11. public class Solution
  12. {
  13.     public static int max = 100;
  14.     public static void main(String[] args) throws IOException
  15.     {
  16.         BufferedReader reader  = new BufferedReader(new InputStreamReader(System.in));
  17.  
  18.         String max = "Max is ";
  19.         int a = Integer.parseInt(reader.readLine());
  20.         int b = Integer.parseInt(reader.readLine());
  21.         Solution.max = Integer.parseInt(String.valueOf(a > b ? a : b));
  22.  
  23.         System.out.println(max + Solution.max);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement