import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int[] arr = new int[26];
for(int i=0; i<26; i++){
arr[i] = -1;
}
String word = br.readLine();
for(int i=0; i<word.length(); i++){
int index = word.charAt(i) - 97;
if(arr[index] == -1) arr[index] = i;
}
for(int num : arr){
System.out.print(num + " ");
}
br.close();
}
}
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str = br.readLine();
for(int i=97; i<=122; i++) {
System.out.print(str.indexOf(i) + " ");
}
br.close();
}
}
'Coding Test > 백준' 카테고리의 다른 글
[백준/자바] 2908 - 상수 (0) | 2023.05.08 |
---|---|
[백준/자바] 2675 - 문자열 반복 (1) | 2023.05.08 |
[백준/자바] 11654 - 아스키 코드 (0) | 2023.05.08 |
[백준/자바] 10811 - 바구니 뒤집기 (0) | 2023.05.08 |
[백준/자바] 3052 - 나머지 (0) | 2023.05.08 |