정수 <= sc.nextInt();
정수 <= sc.nextInt();
정수 <= sc.nextInt();
sc.nextLine();
문자열 <= sc.nextLine();
정수 <= Integer.parseInt(sc.nextInt());
문자열 <= sc.nextLine
예시
package kosta.mission;
import java.text.DecimalFormat;
import java.util.Scanner;
public class Mission01 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int kor,eng,mat,sum;
double avg;
System.out.print("국어 입력 : ");
//kor = sc.nextInt();
kor = Integer.parseInt(sc.nextLine());
System.out.print("영어 입력 : ");
//eng = sc.nextInt();
eng = Integer.parseInt(sc.nextLine());
System.out.print("수학 입력 : ");
//mat = sc.nextInt();
mat = Integer.parseInt(sc.nextLine());
//sc.nextLine();
System.out.println("이름 입력 : ");
String name = sc.nextLine();
sum = kor + eng + mat;
avg = sum / 3.0;
DecimalFormat form = new DecimalFormat("##.##");
System.out.println("이름 : "+ name);
System.out.println("국어 : "+ kor);
System.out.println("영어 : "+ eng);
System.out.println("수학 : "+ mat);
System.out.println("총점 : "+ sum);
System.out.println("평균 : "+ avg);
System.out.println("평균 : "+ form.format(avg));
}
}