coedforce Gym - 101597C (暴力匹配)

K. ACM
time limit per test
2.0 s
memory limit per test
64 MB
input
standard input
output
standard output

Programming contests are fun! So fun in fact, that you find yourself browsing online through hundreds of programming-related tasks, checking if they are about competitive programming. As quite a few of those tasks were not what you were looking for, you were wondering if you could write a program that classifies the problems for you!

You figured out that the following classification works every time: If the task description mentions "ACM", then the task is about competitive programming and will thus be very fun to solve. Otherwise, the task is not.

Input

You are given the task description, consisting of only uppercase letters of the Latin alphabet (A through Z). It is guaranteed that there will be at least one and at most 106 characters.

Output

Print "Fun!" if the statement contains ACM, and "boring..." otherwise.

Examples
input
Copy
SWISSSUBREGIONALACMICPC
output
Copy
Fun!
input
Copy
XXXAXCXMXXX
output
Copy
boring...

           给你一个字符串~让你看看这里面有没有’ACM‘~~

           不过要注意的一个地方是~你不能直接用strlen(m)-2;来作为某个参数;因为这样会引起奇怪的~~变化(strlen(“m”)-2是一个奇怪的数);

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
char m[1000100];
int main()
{
	scanf("%s", m);
	int spot = 0;
	if (strlen(m) == 1)
	{
		printf("boring...\n");
		return 0;
	}
	for (int s = 0; s < strlen(m)-2; s++)
	{
		if (m[s] == 'A'&&m[s+1]=='C'&&m[s+2]=='M')
		{
			spot = 1;
			break;
		}
	}
	if (spot)
	{
		printf("Fun!\n");
	}
	else
	{
		printf("boring...\n");
	}
	return 0;
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值