Skip to content

Instantly share code, notes, and snippets.

@kryvoboker
Created May 5, 2020 18:51
Show Gist options
  • Save kryvoboker/c8c4b2123a93b0eac3996451fa77dc9b to your computer and use it in GitHub Desktop.
Save kryvoboker/c8c4b2123a93b0eac3996451fa77dc9b to your computer and use it in GitHub Desktop.
HomeWork3
import java.util.Scanner;
/**
*
* @author kamaz
*/
public class Main {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in); ПЕРВОЕ ЗАДАНИЕ
int a;
int b;
int c;
int d;
int max;
System.out.println("Input a");
a = sc.nextInt();
System.out.println("Input b");
b = sc.nextInt();
System.out.println("Input c");
c = sc.nextInt();
System.out.println("Input d");
d = sc.nextInt();
max = a;
if (b > max) {
max = b;
}
if (c > max) {
max = c;
}
if ( d > max) {
max = d;
}
System.out.println("Max = " + max);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment