https://www.acmicpc.net/problem/27866
27866번: 문자와 문자열
첫째 줄에 영어 소문자와 대문자로만 이루어진 단어 $S$가 주어진다. 단어의 길이는 최대 $1\,000$이다. 둘째 줄에 정수 $i$가 주어진다. ($1 \le i \le \left|S\right|$)
www.acmicpc.net
#include <stdio.h>
int main() {
char str[2000];
int n;
scanf("%s", str);
scanf("%d", &n);
printf("%c", str[n-1]);
return 0;
}
'c > 백준' 카테고리의 다른 글
11654. 아스키 코드 (0) | 2023.04.06 |
---|---|
2743. 단어 길이 재기 (0) | 2023.04.06 |
2675. 문자열 반복 (0) | 2023.04.06 |
9086. 문자열 (0) | 2023.04.05 |
10872. 팩토리얼 (0) | 2023.04.04 |