MapleStory Finger Point

๐Ÿƒ‍โ™‚๏ธBaekjoon/Java

#27866, #2743 - java

HYEJU01 2024. 4. 15. 23:15
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int i = sc.nextInt();
        
        System.out.println(s.charAt(i-1));
    }
}

 

 


 

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        System.out.println(s.length());
    }
}

 


 

 

 

 

 

<< ๊ฐœ๋… >> 

๐Ÿ”” charAt() : ๋ฌธ์ž์—ด ๊ฐ’์˜ n ๋ฒˆ์งธ ๋ฌธ์ž ๊ฐ€์ ธ์˜ค๋Š” ํ•จ์ˆ˜

๐Ÿ”” nextInt() :์ •์ˆ˜ ๊ฐ’ 

๐Ÿ”” next() : ๊ณต๋ฐฑ/ ๊ฐœํ–‰ ์ด์ „๊นŒ์ง€์˜

๐Ÿ”” nextLine() : ํ•œ์ค„ ๋ฌธ์ž์—ด ์ฝ๊ธฐ ์—”ํ„ฐ(Enter) ํ‚ค๋ฅผ ์ž…๋ ฅ๊นŒ์ง€

๐Ÿ”” nextDouble(): ๋ถ€๋™์†Œ์ˆ˜์  ๊ฐ’