driip (백준 23627)

코딩생활·2023년 10월 22일
0

백준문제풀이

목록 보기
13/308

안녕하세요. 오늘은 driip을 끝낼거예요.

문제

https://www.acmicpc.net/problem/23627

아이디어

문자열 s의 맨 마지막 5자리가 driip이면 됩니다.

소스코드

#include <iostream>
#include <string>
using namespace std;


int main(void)
{
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	string s;
	cin >> s;
	if (s.length() >= 5 && s.substr(s.length() - 5, 5) == "driip") cout << "cute";
	else cout << "not cute";
}


감사합니다.

0개의 댓글