๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ๋ฐœ/์•Œ๊ณ ๋ฆฌ์ฆ˜

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค/JAVA] ์ˆซ์ž ๋ฌธ์ž์—ด๊ณผ ์˜๋‹จ์–ด

by ynzu๐Ÿค 2022. 7. 24.
๋ฐ˜์‘ํ˜•


๐Ÿ‘‡ ๋ฌธ์ œ URL ๐Ÿ‘‡

ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค

์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”.

programmers.co.kr


์†Œ์Šค ์ฝ”๋“œ

String[] engNum = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};  
        
//i๋Š” 0~9
for(int i=0; i<10; i++){
    s = s.replace(engNum[i], Integer.toString(i));
}
        
int answer = Integer.parseInt(s);


๋„ˆ๋ฌด ๊ฐ„๋‹จํ•ด์„œ.. ์ข‹๋‹ค...ใ…Žใ…Ž....๋‹ค ์ด๋Ÿฐ ๋ฌธ์ œ์˜€์œผ๋ฉด....

728x90
๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€