728x90
import java.util.Scanner;
public class scan {
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int a, b;
System.out.println("정수 2개 입력");
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a +" "+ b);
System.out.println("두 수의 합계는" + (a+b) + "이고, 평균은 " + (float)(a+b)/2 +"이다.");
if(a<b)
System.out.println("뒤의 정수가 앞의 정수보다 크다.");
else
System.out.println("앞의 정수가 뒤의 정수보다 크다.");
}
}
'it > programming' 카테고리의 다른 글
| [JAVA] 나누기 몫, 나머지 구하기 (0) | 2013.03.27 |
|---|---|
| [HTML] 130321 웹프밍 수업 - table 태그 (0) | 2013.03.21 |
| [HTML] 130314 웹프밍 수업 - 목록태그 (0) | 2013.03.14 |