Post Robot

时间:2022-09-18 15:01:22
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用户手册 &lpar;版本:3&period;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. &lbrack;8&period;2&rsqb; 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报告会提示&OpenCurlyQuote;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 &sol; Gazebo&comma; Day 2&colon; Enable the robot

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

随机推荐

  1. 【译】Asp&period;net mvc 使用ITextSharp PDF to HTML (解决img标签问题)

    前言:因项目需求,需要将HTML代码转成PDF.大致上已经实现了,可以是发现使用ITextSharp(我现在的版本是5.5.9)的时候,img标签中的src只能跟绝对路径. 在百度上找了一个上午,有一 ...

  2. 使用hive访问elasticsearch的数据

    使用hive访问elasticsearch的数据 1.配置 将elasticsearch-hadoop-2.1.1.jar拷贝到hive/lib hive -hiveconf hive.aux.jar ...

  3. getView 数据最后加一项

    if (position != count-1) {      viewHolder.imgLineEnd.setVisibility(View.GONE); } else {       viewH ...

  4. VS2015 Cordova Ionic移动开发(三)

    一.基础设置 1.修改App名称和程序起始页 打开config.xml配置文件显示如下,在[通用]选项卡中,将显示名称和起始页,修改为自己想要的名称即可. 如需直接在xml文件中修改:右击config ...

  5. Kafka笔记--分布式环境搭建

    部署: http://www.cnblogs.com/likehua/p/3999538.html http://blog.csdn.net/kimmking/article/details/8263 ...

  6. 用js来实现那些数据结构(栈01)

    其实说到底,在js中栈更像是一种变种的数组,只是没有数组那么多的方法,也没有数组那么灵活.但是栈和队列这两种数据结构比数组更加的高效和可控.而在js中要想模拟栈,依据的主要形式也是数组. 从这篇文章开 ...

  7. iOS9 中关闭ATS的方法

    大熊猫猪·侯佩原创或翻译作品.欢迎转载,转载请注明出处. 如果觉得写的不好请多提意见,如果觉得不错请多多支持点赞.谢谢! hopy ;) iOS9中增加了系统的安全性,你会发现默认情况下打开非http ...

  8. CS DevExpress程序启动(主窗体初始化优化)

    在进入程序主界面时,某些情况下主界面的初始化会消耗很长时间,例如一些复杂的业务系统,可能会从服务器上下载最新的数据进行展示等等,在这种情况下,我们可以采用一个进度界面展示“系统正在加载...”,等主界 ...

  9. Fiddler怎么可以抓取https的请求包

    对于https的协议是带有安全的功能,所有有一些的https的协议是无法抓到的,所以需要通过设置filler中来对,来使用filler的方式的来抓取到https的请求包,那么如何使用filler中抓取 ...

  10. python subprocess中ssh命令的特殊性

    今天尝试使用python 的 subprocess 模块 使用类似如下语句: p=subprocess.Popen(['ssh','root@localhost'],stdout=subprocess ...