public class Excercise_224 { public static void main(String[] args) { Scanner input = new Scanner(System.in); int num1 = input.nextInt(); int num2 = input.nextInt(); int num3 = input.nextInt(); int num4 = input.nextInt(); int num5 = input.nextInt(); int Max_memory = 0; if (num1 > Max_memory) Max_memory = num1; if (num2 > Max_memory) Max_memory = num2; if (num3 > Max_memory) Max_memory = num3; if (num4 > Max_memory) Max_memory = num4; if (num5 > Max_memory) Max_memory = num5; System.out.println("최대값은 " + Max_memory); } }
import java.util.Scanner;
public class Excercise_225 {
public static void main(String[] args) { Scanner input = new Scanner(System.in); int number = input.nextInt(); if (number % 2 == 0) System.out.println("짝수입니다."); else System.out.println("홀수입니다."); } }
import java.util.*;
public class Excercise_226 { public static void main(String[] args) { Scanner input = new Scanner(System.in); int num1 = input.nextInt(); int num2 = input.nextInt(); System.out.println("두수를 곱한 값은" + num1 * num2); } }
import java.util.*;
public class Excercise_230 { public static void main(String[] args) { Scanner input = new Scanner(System.in); int num = input.nextInt(); String numToString; Integer changenumToObject = new Integer(num); numToString = changenumToObject.toString(); for(int i = 0; i <numToString.length(); i++) System.out.print(numToString.charAt(i)+" ");
} }
public class Excercise_231 { public static void main(String[] args) { System.out.println("number " + "square " + "cube"); for (int index = 0; index < 11; index++) System.out.println(index + " " + index * index + " " + index * index * index);
} }
public class Excercise_232 { public static void main(String[] args) {
Scanner input = new Scanner(System.in); int numbers[] = new int[5]; int count_NegativeNumber = 0; int count_Zero = 0; int count_PositiveNumber = 0; for (int i = 0; i < numbers.length; i++) { numbers[i] = input.nextInt(); if (numbers[i] < 0) count_NegativeNumber++; if (numbers[i] == 0) count_Zero++; if (numbers[i] > 0) count_PositiveNumber++; }
System.out.println("the Number of negative numbers : " + count_NegativeNumber); System.out.println("the Number of zero numbers : " + count_Zero); System.out.println("the Number of positive numbers : " + count_PositiveNumber); } }