태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.
import java.util.Scanner;
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


참~ 쉽죠잉

+ Recent posts