hdu 5007 水题 (2014西安网赛A题)
题意:出现Apple、iPod、iPhone、iPad时输出MAI MAI MAI!,出现Sony,输出SONY DAFA IS GOOD!
Sample Input
Apple bananaiPad lemon ApplepiSony
233
Tim cook is doubi from Apple
iPhoneipad
iPhone30 is so biiiiiiig Microsoft
makes good App.
Sample Output
MAI MAI MAI!
MAI MAI MAI!
MAI MAI MAI!
SONY DAFA IS GOOD!
MAI MAI MAI!
MAI MAI MAI!
MAI MAI MAI!
# include <iostream>
# include <cstdio>
# include <cstring>
# include <string>
# include <algorithm>
# include <cmath>
# include <queue>
# define LL long long
using namespace std ; int main ()
{
//freopen("in.txt","r",stdin) ;
string s ;
while(cin>>s)
{
int len = s.size() ;
int i ;
for (i = ; i < len ; i++)
{
string a = s.substr(i,) ;
if (a == "iPad" ||a == "iPod")
cout<<"MAI MAI MAI!"<<endl ;
else if (a == "Sony")
cout<<"SONY DAFA IS GOOD!"<<endl ;
string b = s.substr(i, );
if (b == "Apple")
cout<<"MAI MAI MAI!"<<endl ;
string c = s.substr(i, );
if (c == "iPhone")
cout<<"MAI MAI MAI!"<<endl ; }
} return ;
}
hdu 5007 水题 (2014西安网赛A题)的更多相关文章
- hdu 5011 nim博弈 (2014西安网赛E题)
n堆石子,每次可以选一堆取走至少一个,之后你可以不操作或者把该堆石子分成两堆,每堆至少一个,和还是原来(取完石子后)的石子个数. Sample Input1121 131 2 3 Sample Out ...
- ACM学习历程——HDU5017 Ellipsoid(模拟退火)(2014西安网赛K题)
---恢复内容开始--- Description Given a 3-dimension ellipsoid(椭球面) your task is to find the minimal distanc ...
- hdu 5003 模拟水题 (2014鞍山网赛G题)
你的一系列得分 先降序排列 再按0.95^(i-1)*ai 这个公式计算你的每一个得分 最后求和 Sample Input12530 478Sample Output984.1000000000 # ...
- hdu 5053 (2014上海网赛L题 求立方和)
题目大意:给你L到N的范围,要求你求这个范围内的所有整数的立方和. Sample Input2 //T1 32 5 Sample OutputCase #1: 36Case #2: 224 # inc ...
- zoj 3809 枚举水题 (2014牡丹江网赛 A题)
题目大意:给出一列取样的几个山的高度点,求山峰有几个? Sample Input 291 3 2 4 6 3 2 3 151 2 3 4 5Sample Output 30 # include < ...
- ACM学习历程——HDU 5014 Number Sequence (贪心)(2014西安网赛)
Description There is a special number sequence which has n+1 integers. For each number in sequence, ...
- HDU 4746 HDOJ Mophues 2013杭州网赛I题
比赛的时候就预感到这题能出,但是会耗时比较多.结果最后是出了,但是有更简单的题没出. 是不是错误的决策呢?谁知道呢 题目意思: 定义f(x) = x分解质因数出来的因子个数 如 x = p0 * p0 ...
- HDU 5009 Paint Pearls(西安网络赛C题) dp+离散化+优化
转自:http://blog.csdn.net/accelerator_/article/details/39271751 吐血ac... 11668627 2014-09-16 22:15:24 A ...
- 2014西安现场赛F题 UVALA 7040
地址 题意:求在m种颜色中挑选k种颜色,给n个花朵涂色有几种方法. 分析:画图可以发现,基本的公式就是k ×(k-1)^(n-1).但这仅保证了相邻颜色不同,总颜色数不超过k种,并没有保证恰好出现k种 ...
随机推荐
- Codeforces 464D-World of Darkraft - 2
题意 有 \(n\) 个怪兽,\(k\) 种装备.最开始每个装备的等级都是 1 .每打完一个怪兽就会随机掉落一个装备. 随机的方式是,先等概率随机一个装备种类,设当前这个装备的等级为 \(t\) ,那 ...
- 【转】Keil ARM开发 error L6236E错误解决
顺利创建了第一个Keil工程却发现不能完成链接,出现了一个下面这样的报错: .\Objects\demo_simple.sct(7): error: L6236E: No section matche ...
- 使用 docker 创建自己的镜像
docker run 命令 镜像(image):An image is a filesystem and parameters to use at runtime. It doesn't have s ...
- (转)灵活控制 Hibernate 的日志或 SQL 输出,以便于诊断
背景:项目开发需要.之前对于hibernate日志输出,log4j的绑定,之间的关系一直不是很清楚.终于找到一篇介绍的很详细的文章. 文章出处:https://unmi.cc/hibernate-lo ...
- 各种蕴含算法思想的DP - 1
study from: https://www.cnblogs.com/flashhu/p/9480669.html 1.前缀和 https://www.luogu.org/problemnew/sh ...
- spring task 实现定时执行(补充:解决定时任务执行2次问题)
首先在spring-mvc.xml配置头文件引入: xmlns:task="http://www.springframework.org/schema/task" 其次引入task ...
- OpenStack 认证服务 KeyStone 服务注册(五)
创建服务实体和API端点 创建服务 openstack service create --name keystone --description "OpenStack Identity&qu ...
- CF&&CC百套计划4 Codeforces Round #276 (Div. 1) E. Sign on Fence
http://codeforces.com/contest/484/problem/E 题意: 给出n个数,查询最大的在区间[l,r]内,长为w的子区间的最小值 第i棵线段树表示>=i的数 维护 ...
- spring框架学习(二)使用注解代替xml配置
注解 1.使用注解配置spring 1)开启使用注解代理配置文件 <?xml version="1.0" encoding="UTF-8"?> &l ...
- html5 canvas贝塞尔曲线篇(下)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...