문자열을 다 입력받고, 빼야 될 index는 제외하고 출력하면 답이다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
/** | |
* https://www.acmicpc.net/problem/2711 | |
* BOJ 백준온라인져지 2711 오타맨 고창영 풀이 | |
*/ | |
int main(){ | |
char *word = new char[81]; | |
int testCase; | |
scanf("%d", &testCase); | |
while(testCase--){ | |
int index; | |
scanf("%d", &index); | |
int i = 0; | |
while(1){ | |
char temp; | |
scanf("%c", &temp); | |
if(temp == ' ') continue; | |
if(temp >= 'A' && temp <= 'Z') word[i++] = temp; | |
else break; | |
} | |
for(int ii = 0; ii < i; ii++){ | |
if(ii == index - 1) continue; | |
printf("%c", word[ii]); | |
} | |
printf("\n"); | |
} | |
} |
'IT > 알고리즘' 카테고리의 다른 글
BOJ 백준온라인져지 2702 초6 수학 풀이 (0) | 2017.12.11 |
---|---|
BOJ 백준온라인져지 13410 거꾸로 구구단 풀이 (0) | 2017.12.11 |
BOJ 백준온라인져지 6359 만취한 상범 풀이 (0) | 2017.12.11 |
BOJ 백준온라인져지 6378 디지털 루트 풀이 (0) | 2017.12.11 |
BOJ 백준온라인져지 6376 e 계산 풀이 (0) | 2017.12.11 |