본문 바로가기

CodeUp

C언어) CodeUp 1733 [I.O.I]

문제 설명   

정보 선생님은 프로젝트 걸그룹 IOIIOI를 매우 싫어 한다.

그 이유는 국제정보올림피아드(InternationalInternational OlympiadOlympiad inin InformaticsInformatics:IOIIOI)의 이름과 동일해서,

인터넷 검색창에 IOIIOI를 입력할 경우 더 이상 국제정보올림피아드에 대한 정보를 찾기가 힘들어 졌기 때문이다.

입력으로 IOIIOI가 입력될 경우, IOI is the International Olympiad in Informatics.를 출력하는 프로그램을 작성하시오.

만약 IOIIOI가 아닌 다른 글자가 들어오는 경우, I don't care.를 출력한다.

입력

알파벳 한 단어가 입력된다.

출력

대문자 IOIIOI가 입력되면, IOI is the International Olympiad in Informatics.를 출력하고, 그 외에는 I don't care.를 출력하시오.

입력 예시   예시 복사

IOI

출력 예시

IOI is the International Olympiad in Informatics.

 

1
2
3
4
5
6
7
8
9
10
11
12
#include <stdio.h>    
#include <string.h>
 
int main() {
    char a[100= { 0 };
    scanf("%s", a);
    int len = strlen(a);
    for (int i = 0;i < len;i++) {
        if (a[i] == 't')
            printf("%d ", i + 1);
    }
}
http://colorscripter.com/info#e" target="_blank" style="text-decoration:none;color:white">cs

문제 풀이 방법 : strcmp 를 사용하면 간단하게 풀 수 있는 문제입니다. strcmp 함수를 모른다면

공부하시는 것을 추천합니다.


/*스크롤 인디케이터 시작*/ .header { position: absolute; top: 0; z-index: 1; width: 100%; background-color: #fff; } .progress-container { width: 100%; height: 4px; background: #f6f6f6; } .progress-bar { height: 4px; background: #6C6C6C; width: 0%; } /*스크롤 인디케이터 종료*/ /*왼쪽, 좌측 밑의 이미지 추가 시작*/ /*가로의 길이가 1510일때까지는 보여라*/ @media screen and (min-width:1500px) { .main_ad { display:visible; position: absolute; left: 0px; bottom: 80px; cursor: pointer; z-index: 11; } } /*가로의 길이가 1511일까지는 보이지 말아라*/ @media screen and (max-width:1510px) { .main_ad { display:none; position: absolute; left: 0px; bottom: 80px; cursor: pointer; z-index: 11; } } /*왼쪽, 좌측 밑의 이미지 추가 종료*/ /*이웃추가버튼 추가 시작*/ @media screen and (min-width:500px) { .add_adBanner { display:visible; } } @media screen and (max-width:510px) { .add_adBanner { display:none; } } .add_adBanner ul { position: absolute; left: 10px; bottom: 22px; cursor: pointer; z-index: 12; } .add_adBanner li { margin : 0 0 0 0; padding : 0 0 0 0; border : 0; float : left; } /*이웃추가버튼 추가 종료*/