๐ java
๋ ์ ์ A์ B๋ฅผ ์ ๋ ฅ๋ฐ์ ๋ค์, A+B๋ฅผ ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค.
import java.util.*;
class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int A = in.nextInt();
int B = in.nextInt();
System.out.println(A+B);
}
}
in.nextByte(); // byteํ ์
๋ ฅ ๋ฐ ๋ฆฌํด
in.nextShort(); // shortํ ์
๋ ฅ ๋ฐ ๋ฆฌํด
in.nextInt(); // intํ ์
๋ ฅ ๋ฐ ๋ฆฌํด
in.nextLong(); // longํ ์
๋ ฅ ๋ฐ ๋ฆฌํด
in.nextFloat(); // floatํ ์
๋ ฅ ๋ฐ ๋ฆฌํด
in.nextDouble(); // doubleํ ์
๋ ฅ ๋ฐ ๋ฆฌํด
in.nextBoolean(); // booleanํ ์
๋ ฅ ๋ฐ ๋ฆฌํด
in.next(); // stringํ ์
๋ ฅ ๋ฐ ๋ฆฌํด(๊ณต๋ฐฑ๊ธฐ์ค์ผ๋ก ํ๋จ์ด๋ฅผ ์ฝ์)
in.nextLine(); // stringํ ์
๋ ฅ ๋ฐ ๋ฆฌํด(๊ฐํ์ ๊ธฐ์ค์ผ๋ก ํ ์ค์ ์ฝ์)