๋ฐ์ํ
import java.util.Scanner;
public class Main {
// 11021 A+B - 7
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
String[] out = new String[t];
for (int i=0; i<t; i++) {
int sum = 0;
int a = sc.nextInt();
int b = sc.nextInt();
out[i] = "Case #" + (i+1) + ": " + (a+b);
}
sc.close();
for (String o : out) {
System.out.println(o);
}
}
}
๋ณ์ํ์
๋ณ์๋ช
๋์
(=)์ ํ ๋..
String out = "Case #" + (a + b);
๋์
ํ ๊ฐ์ด ๋จผ์ ์คํ๋๋๋ฐ "Case #" + (a + b)
() ๊ฐ๋ก ์์ด ๋จผ์ ์คํ๋ฉ๋๋ค.
์ฐ์ฐ์์ฐ์ ์์๋ฅผ ๋์ถฉ ์์ง๋ง ๋ฌ๋ฌ ์ธ์ฐ๊ธฐ๋ณด๋จ
๊ผญ ๋จผ์ ๊ณ์ฐํด์ผ ํ ๊ฐ์ด ์๋ค๋ฉด ()๊ฐ๋ก ์์ ๋ฃ๋๋ค. ๋ผ๊ณ ์๊ฐํ๋ฉด ํธํฉ๋๋ค.
๋ฐ์ํ
'๐ธ Algorithm > ๐ธ ๋ฐฑ์ค BaekJoon' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค][java][2438][๋ณ ์ฐ๊ธฐ - 1] (0) | 2023.10.09 |
---|---|
[๋ฐฑ์ค][java][11022][A+B - 8] (1) | 2023.10.08 |
[๋ฐฑ์ค][java][15552][๋น ๋ฅธ A+B] (1) | 2023.10.08 |
[๋ฐฑ์ค][java][25314][์ฝ๋ฉ์ ์ฒด์ก๊ณผ๋ชฉ ์ ๋๋ค] (0) | 2023.10.03 |
[๋ฐฑ์ค][java][25304][์์์ฆ] (0) | 2023.10.03 |