← Back to List

15904번: UCPC는 무엇의 약자일까? ↗

Solutions

C++14
316 B | 316 chars
#include <iostream>
#include <string>
using namespace std;
int K;
string a;
string b="UCPC";
int main()
{
	getline(cin,a);
	for(int x=0; x<a.length(); x++)
	{
		if(K==4)
		{
			cout<<"I love UCPC";
			return 0;
		}		
		if(a[x]==b[K]) K++;
	}
	if(K==4)
	{
		cout<<"I love UCPC";
		return 0;
	}
	cout<<"I hate UCPC";
}