SWEA_2050) 알파벳을 숫자로 변환
SWEA
# D1
2050) 알파벳을 숫자로 변환 (19.10.02)
문제 링크 (SW Expert Academy)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import java.io.*;
public class Solution {
public static void main(String args[]) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
String s = br.readLine();
for(int i=0;i<s.length();i++) {
int n = s.charAt(i)-'A'+1;
bw.write(n +" ");
}
bw.flush();
bw.close();
}
}
| cs |
댓글
댓글 쓰기