목록27866 (2)
안경잡이 구루루
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/brgqLl/btsAxJ3JHpu/WuvzuORhAm6vOgMGUEJak1/img.png)
https://www.acmicpc.net/problem/27866 27866번: 문자와 문자열 첫째 줄에 영어 소문자와 대문자로만 이루어진 단어 $S$가 주어진다. 단어의 길이는 최대 $1\,000$이다. 둘째 줄에 정수 $i$가 주어진다. ($1 \le i \le \left|S\right|$) www.acmicpc.net 나: #define _CRT_SECURE_NO_WARNINGS #include int main() { char s[1000]; int i; scanf("%s", &s); scanf("%d", &i); printf("%c", s[i-1]); return 0; } 완성된 코드는 위와 같다, 우선 VS 에서 scanf() 오류를 막기 위해 #define CRT_SECURE_NO_WARNI..
![](http://i1.daumcdn.net/thumb/C150x150.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/bivrEc/btsr4lKcGlC/gqSNhH90TGMtze5umrxxO1/img.png)
https://www.acmicpc.net/problem/27866 27866번: 문자와 문자열 첫째 줄에 영어 소문자와 대문자로만 이루어진 단어 $S$가 주어진다. 단어의 길이는 최대 $1\,000$이다. 둘째 줄에 정수 $i$가 주어진다. ($1 \le i \le \left|S\right|$) www.acmicpc.net 나: word = input() index = int(input()) print(word[index-1]) 완성된 코드는 위와 같다. (1) word = input() index = int(input()) 문제의 단어S 를 word 변수로 받았다. 그리고 문제의 i를 index로 사용하기 위해 int형 입력값을 받았다. print(word[index-1]) 문제 속 i 는 문자열의 ..