반응형
import java.util.Scanner;
public class Round04Homeword2 {
public class Round04Homeword2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
String name = "";
int total = 0;
Scanner input = new Scanner(System.in);
System.out.println("name:");
name = input.nextLine();
System.out.println("nation language:");
total = total + input.nextInt();
System.out.println("english:");
total = total + input.nextInt();
System.out.println("mathemetics:");
total = total + input.nextInt();
System.out.printf("Mr.%s, your score is\n", name);
System.out.printf("total: %d\n",total);
System.out.printf("avg: %3.2f\n", 1.0*total/3);
}
}
---------------
결과
---------------
name:
kkk
nation language:
100
english:
90
methetics:
100
Mr.kkk, your score is
total: 290
avg: 96.67
kkk
nation language:
100
english:
90
methetics:
100
Mr.kkk, your score is
total: 290
avg: 96.67
참~ 쉽죠잉
반응형
'TechNical > JAVA' 카테고리의 다른 글
1부터 100까지 줄 맞춰서 찍기 (0) | 2009.11.09 |
---|---|
자바 기초 공부할 만한 사이트 (0) | 2009.11.09 |
자바 기초부터 후다닥 (0) | 2009.11.09 |
이클립스 코드 폴딩 플러그인 (0) | 2009.09.23 |
JTable 이것저것 거시기 (1) | 2009.03.02 |
댓글