public class Test001 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a, b;
System.out.print("첫번째 정수를 입력해 주세요: ");
a = sc.nextInt();
System.out.print("두번째 정수를 입력해 주세요: ");
b = sc.nextInt();
if (a>b)
{
System.out.printf("첫번째 정수: %d\n",a);
System.out.printf("두번째 정수: %d\n",b);
System.out.println("큰 수는 " + a);
}
else
{
System.out.printf("첫번째 정수: %d\n",a);
System.out.printf("두번째 정수: %d\n",b);
System.out.println("큰 수는 " + b);
}
}
}
댓글 없음:
댓글 쓰기