티스토리 뷰
틀린 코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package practice;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = 0;
int B = 0;
System.out.print("A와 B 값을 차례대로 입력하세요");
A = sc.nextInt();
B = sc.nextInt();
System.out.println(A+B);
}
}
|
수정 후 정답 코드
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
package practice;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int A = 0;
int B = 0;
A = sc.nextInt();
B = sc.nextInt();
System.out.println(A+B);
}
}
|
" System.out.print("A와 B 값을 차례대로 입력하세요");" 이거 한 줄 때문에 틀렸당....따흐흑
괜히 문제에 없는 코드 덧붙이지 말자~~~