Banner

My Tech Blog (oooxoo)

โœ… ๋ฌธ์ œ์Šค๋งˆํŠธ๋ฏธ๋””์–ด์ธ์žฌ๊ฐœ๋ฐœ์›์˜ ์ธ์Œค์ด Java ์‹œํ—˜๋ฌธ์ œ๋ฅผ ์ฑ„์ ํ•˜๊ณ  ์žˆ๋‹ค.๋ฌธ์ œ๋งˆ๋‹ค 'o' ๋˜๋Š” 'x'๋กœ ํ‘œ์‹œ๊ฐ€ ๋˜์–ด ์žˆ๋Š”๋ฐ ์ ์ˆ˜๋ฅผ ๋งค๊ธฐ๋Š” ๋ฐฉ์‹์ด ํŠน์ดํ•˜๋‹ค.'o'๋Š” ์ ์ˆ˜๊ฐ€ ๋ˆ„์ ๋˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์ฑ„์ ๋˜๋Š”๋ฐ ์ด์ „๋ถ€ํ„ฐ ์ž์‹ ์„ ํฌํ•จํ•œ ์—ฐ์†๋œ 'o'์˜ ๊ฐœ์ˆ˜ ๋งŒํผ์˜ ์ ์ˆ˜๋กœ ์ฑ„์ ์ด ๋ฉ๋‹ˆ๋‹ค.์˜ˆ๋ฅผ ๋“ค์–ด 'oooxoo'๋ผ๋Š” ํ‘œ์‹œ๊ฐ€ ์žˆ๋‹ค๋ฉด ์ˆœ์„œ๋Œ€๋กœ 1+2+3+0+1+2=9 ์œผ๋กœ ์ด์ ์ด ๊ณ„์‚ฐ๋ฉ๋‹ˆ๋‹ค.ํ•™์ƒ์ด ํ‘ผ ์‹œํ—˜์ง€์— ์ •๋‹ต, ์˜ค๋‹ต ์—ฌ๋ถ€๊ฐ€ ํ‘œ์‹œ๋˜์–ด ์žˆ์„ ๋•Œ ์ด์ ์„ ๊ตฌํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์„ธ์š”. โœ… ์ฝ”๋“œimport java.util.Scanner;public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String c..
์ธ์ ˆ๋ฏธ์˜€๋˜๊ฒƒ
'oooxoo' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก
์ƒ๋‹จ์œผ๋กœ