Problem Description
DT is a big fan of digital products. He writes posts about technological products almost everyday in his blog.

But there is such few comments of his posts that he feels depressed all the day. As his best friend and an excellent programmer, DT asked you to help make his blog look more popular. He is so warm that you have no idea how to refuse. But you are unwilling to read all of his boring posts word by word. So you decided to write a script to comment below his posts automatically.

After observation, you found words “Apple” appear everywhere in his posts. After your counting, you concluded that “Apple”, “iPhone”, “iPod”, “iPad” are the most high-frequency words in his blog. Once one of these words were read by your smart script, it will make a comment “MAI MAI MAI!”, and go on reading the post.

In order to make it more funny, you, as a fan of Sony, also want to make some comments about Sony. So you want to add a new rule to the script: make a comment “SONY DAFA IS GOOD!” when “Sony” appears.

 
Input
A blog article described above, which contains only printable characters(whose ASCII code is between 32 and 127), CR(ASCII code 13, ‘\r’ in C/C++), LF(ASCII code 10, ‘\n’ in C/C++), please process input until EOF. Note all characters are case sensitive.

The size of the article does not exceed 8KB.

 
Output
Output should contains comments generated by your script, one per line.
 
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 <stdio.h>
#include <string.h> int main(){
char c;
char s[];
int i;
int length; while(scanf("%c",&c)!=EOF){
i=;
while(c!='\n'){
s[i]=c;
i++;
c=getchar();
}
s[i]='\0';
length=strlen(s); for(i=;i<length;i++){
if(i+<length && s[i]=='A' && s[i+]=='p' && s[i+]=='p' && s[i+]=='l' && s[i+]=='e')
printf("MAI MAI MAI!\n"); if(i+<length && s[i]=='i' && s[i+]=='P' && s[i+]=='h' && s[i+]=='o' && s[i+]=='n' && s[i+]=='e')
printf("MAI MAI MAI!\n"); if(i+<length && s[i]=='i' && s[i+]=='P' && s[i+]=='o' && s[i+]=='d')
printf("MAI MAI MAI!\n"); if(i+<length && s[i]=='i' && s[i+]=='P' && s[i+]=='a' && s[i+]=='d')
printf("MAI MAI MAI!\n"); if(i+<length && s[i]=='S' && s[i+]=='o' && s[i+]=='n' && s[i+]=='y')
printf("SONY DAFA IS GOOD!\n");
} }
return ;
}

Post Robot的更多相关文章

  1. Robot Framework用户手册 (版本:3.0)

    版权信息:诺基亚网络和解决中心 本翻译尊重原协议,仅用于个人学习使用 1.开始: 1.1 介绍: Robot Framework是一个基于Python的,为终端测试和验收驱动开发(ATDD)的可扩展的 ...

  2. selenium webdriver 右键另存为下载文件(结合robot and autoIt)

    首先感谢Lakshay Sharma 大神的指导 最近一直在研究selenium webdriver右键菜单,发现selenium webdriver 无法操作浏览器右键菜单,如图 如果我想右键另存为 ...

  3. RIDE -- Robot Framework setup

    RobotFramework 是一款基于python 的可以实现关键字驱动和数据驱动并能够生成比较漂亮的测试报告的一款测试框架 这里使用的环境是 python-2.7.10.amd64.msi RID ...

  4. [8.2] Robot in a Grid

    Imagine a robot sitting on the upper left corner of grid with r rows and c columns. The robot can on ...

  5. Robot Framework自动化测试 ---视频与教程免费分享

    当我第一次使用Robot Framework时,我是拒绝的.我跟老大说,我拒绝其实对于习惯了代码的自由,所以讨厌这种“填表格”式的脚本.老大说,Robot Framework使用简单,类库丰富,还可以 ...

  6. robot创建桌面图标(转载)

    桌面ride图标,安装之后会自动创建(偶尔也会创建失败),创建桌面图标方法如下: 1. 新建快捷方式 在桌面右击鼠标,弹出的菜单选择 新建-快捷方式 ,然后在"请键入对象"的位置输 ...

  7. Robot Framework 的安装和配置(转载)

    Robot Framework 的安装和配置 在使用 RF(Rebot framework)的时候需要 Python 或 Jython 环境,具体可根据自己的需求来确定.本文以在有 Python 的环 ...

  8. 解决从jenkins打开robot framework报告会提示‘Opening Robot Framework log failed ’的问题

    最新的jenkins打开jenkins robot framework报告会提示如下 Verify that you have JavaScript enabled in your browser.  ...

  9. 在centos7中安装Robot Framework

    安装前景介绍: 最初,我们是在Windows环境下搭建Robot Framework来对我们的服务进行接口测试的(想知道如何在Windows下安装Robot Framework,可以参考我同事的博客h ...

  10. Making my own Autonomous Robot in ROS / Gazebo, Day 2: Enable the robot

    Day 2: Enable the robot Git Setting git checkout master git branch day2_enable_robot git push --set- ...

随机推荐

  1. 【转】B树、B-树、B+树、B*树

    B树 即二叉搜索树: 1.所有非叶子结点至多拥有两个儿子(Left和Right): 2.所有结点存储一个关键字: 3.非叶子结点的左指针指向小于其关键字的子树,右指针指向大于其关键字的子树: 如: B ...

  2. hdu 1155 Bungee Jumping

    http://acm.hdu.edu.cn/showproblem.php?pid=1155 Bungee Jumping Time Limit: 2000/1000 MS (Java/Others) ...

  3. 最精简的IOCP封装

    最精简的IOCP封装,DELPHI XE8直接编译通过.Winsock2.pas即使用DELPHI自带的,相信XE7也能编译,或者XE6,XE5也能. 单说Winsock2.pas,我见过无数种版本的 ...

  4. oracle学习 三(持续更新中)

    关于ora 01219问题的解决 之前学习oracle的时候练习去建立表空间,建了很多之后手动删除了,之后再使用自己创建的用户名登陆数据库就会造成数据库 ORA-01031: ORACLE initi ...

  5. linux 5 配置xmanager

    0 关闭防火墙或者打开177端口 iptables -A INPUT -p udp --dport 177 -j ACCEPT 1.vi /etc/inittab id:5:initdefault:  ...

  6. winForm开发

    http://www.cnblogs.com/wuhuacong/p/3199829.html http://www.cnblogs.com/peterzb/archive/2009/06/30/15 ...

  7. sudo权限集中管理用法

    #定义一组命令集合,名称DBA_CMD,禁止使用的命令前加!即可Cmnd_Alias DBA_CMD =  /bin/touch,/bin/mkdir,/sbin/service,/sbin/chkc ...

  8. Chrome的JS调试工具

    你是怎么调试 JavaScript 程序的?最原始的方法是用 alert() 在页面上打印内容,稍微改进一点的方法是用 console.log() 在 JavaScript 控制台上输出内容.嗯~,用 ...

  9. C++运算符重载的规则

    运算符重载的规则如下: 1.C++中的运算符除了少数几个之外,全部可以重载,而且只能重载C++中已经有的运算符. 2.重载之后运算符的优先级和结合性都不会改变 3.运算符重载是针对新类型数据的实际需要 ...

  10. vim复制多行<转>

    比如我要复制从第1行到第5行的数据,复制到第9行 光标移到第5行任意位置,输入ma光标移到第1行任意位置,输入y'a(这一定要打这个“'”单引号,否则就进入“INSERT”状态了光标移到需要复制的行, ...