728x90

풀이)

import java.util.Scanner;
import java.io.FileInputStream;
 

class Solution
{
    public static void main(String args[]) throws Exception
    {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        s = s.toUpperCase();
 
        for(int i=0; i<s.length(); i++){
            char c = s.charAt(i);
            System.out.print((int)c-64+" ");
        }
    }
}

아스키 코드 A가 65를 이용해서 풀었다.

char A 는

System.out.print((int)A)를 하면 65가 나오는 점을 이용해서 문제를 풀었다.

 

728x90