Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class largestOf3Numbers {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- System.out.println("Введите три числа: ");
- int a = scan.nextInt();
- int b = scan.nextInt();
- int c = scan.nextInt();
- if (a > b && a > c){
- System.out.println("Максимальное число: " + a);
- }
- else if (b > a && b > c){
- System.out.println("Максимальное число: " + b);
- }
- else {
- System.out.println("Максимальное число: " + c);
- }
- }
- }
Add Comment
Please, Sign In to add comment