HDOJ(HDU) 4847 Wow! Such Doge!(doge字符统计)
Problem Description
Chen, Adrian (November 7, 2013). “Doge Is An Ac- tually Good Internet Meme. Wow.”. Gawker. Retrieved November 22, 2013.
Doge is an Internet meme that became popular in 2013. The meme typically con- sists of a picture of a Shiba Inu dog ac- companied by multicolored text in Comic Sans MS font in the foreground. The text, representing a kind of internal monologue, is deliberately written in broken English, and usually contains the word “wow” and the phrases “such x”, “much x”, “many x”, “very x” and “so x”.
Kabosu, the Shiba Inu featured in the original meme, was first pictured in a 2010 blog post by Atsuko Sato, a Japanese kindergarten teacher. Afterwards, varia- tions of the pictures using overlaid Comic Sans text were posted from a Tumblr blog, Shiba Confessions. However, the use of the intentionally misspelled “doge” dates back to June 2005, when it was mentioned in an episode of Homestar Runners puppet series.
In August 2013, images of the meme were spammed on Reddit’s r/MURICA subreddit by 4chan’s random imageboard, /b/. A search of the term doge on Google Trends shows an explosion of popularity occurring in October 2013, and more so in the following month. By November 2013, the meme had become widespread on the Internet. Google later created a Doge Easter egg: when doge meme was entered into the YouTube search bar, all of the site’s text would be displayed in colorful Comic Sans, similar to the kind used by the meme.
The meme was ranked #12 on MTV’s list of “50 Things Pop Culture Had Us Giving Thanks For” in 2013. Io9 compared the internal dialog of the Shiba Inu dogs to lolcat-speak. The image most commonly associated with the meme is of a female Shiba Inu named Kabosu, taken from a Japanese blog documenting the dog’s daily activities. The spelling of doge has several variants, leading to debate on its actual pronunciation. On December 13, Doge was named the “top meme” of 2013 by Know Your Meme.
In December 2013, the Dogecoin was introduced as a new cryptocurrency, making it the first cryptocurrency to be based on an Internet meme; the viral phenomenon, along with usage of the Comic Sans MS typeface, gave it “the Internet density of a large star” according to Medium writer Quinn Norton.
In late December 2013, members of the U.S. Congress produced material in the meme’s style. Huffington Post commented that Doge was “killed” because of the Congress members’ usage of the meme.
By early 2014, Doge’s popularity was sustained by internet communities on social media, accompanied by the rapid growth and acceptance of Dogecoin. In April 2014, Doge experienced a second major media resurgence due to revelations of the Dogecoin community’s intent to sponsor Josh Wise in NASCAR and place a picture of the Shiba Inu on his vehicle.
—— Doge (meme). (2014, May 18).
In Wikipedia, The Free Encyclopedia. Retrieved 02:00, May 22, 2014, from
http://en.wikipedia.org/w/index.php?title=Doge_(meme)&oldid=609040691
Now, Doge wants to know how many words “doge” are there in a given article. Would you like to help Doge solve this problem?
Input
An article that Doge wants to know.
The size of the article does not exceed 64KB. The article contains only ASCII characters.
Output
Please output the number of word “doge” (case-insensitive). Refer to the samples for more details.
Sample Input
adoge
cutedo
yourge
blownDoge
lovelyDooge
Wow! Such Dooooooooooooooge!!!
D0ge
dOge DOGE
dogedoge
Sample Output
6
题目的输出没有结束标志,就是让你在文件结束输出doge这个单词出现的次数,不区分大小写!
import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int sum=0;
while(sc.hasNext()){
String str =sc.next();
for(int i=0;i<str.length()-3;i++){
if(str.charAt(i)=='d'||str.charAt(i)=='D'){
if(str.charAt(i+1)=='o'||str.charAt(i+1)=='O'){
if(str.charAt(i+2)=='g'||str.charAt(i+2)=='G'){
if(str.charAt(i+3)=='e'||str.charAt(i+3)=='E'){
sum++;
i=i+3;
}
}
}
}
}
}
System.out.println(sum);
}
}
HDOJ(HDU) 4847 Wow! Such Doge!(doge字符统计)的更多相关文章
- HDU 4847 Wow! Such Doge!
Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...
- HDOJ/HDU 2140 Michael Scofield's letter(字符转换~)
Problem Description I believe many people are the fans of prison break. How clever Michael is!! In o ...
- HDU 4847 陕西邀请赛A(水)
HDU 4847 Wow! Such Doge! pid=4847" style="">题目链接 题意:给定文本,求有几个doge,不区分大写和小写 思路:水题.直 ...
- (KMP 水)Wow! Such Doge! -- hdu -- 4847
http://acm.hdu.edu.cn/showproblem.php?pid=4847 Wow! Such Doge! Time Limit:1000MS Memory Limit:32 ...
- hdu4847 Wow!Such Doge!【字符串】【暴力】
Wow! Such Doge! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...
- HDOJ(HDU).1035 Robot Motion (DFS)
HDOJ(HDU).1035 Robot Motion [从零开始DFS(4)] 点我挑战题目 从零开始DFS HDOJ.1342 Lotto [从零开始DFS(0)] - DFS思想与框架/双重DF ...
- HDOJ(HDU).1015 Safecracker (DFS)
HDOJ(HDU).1015 Safecracker [从零开始DFS(2)] 从零开始DFS HDOJ.1342 Lotto [从零开始DFS(0)] - DFS思想与框架/双重DFS HDOJ.1 ...
- HDU 4850 Wow! Such String!(欧拉道路)
HDU 4850 Wow! Such String! 题目链接 题意:求50W内的字符串.要求长度大于等于4的子串,仅仅出现一次 思路:须要推理.考虑4个字母的字符串,一共同拥有26^4种,这些由这些 ...
- hdu 4850 Wow! Such String! 欧拉回路
作者:jostree 转载请注明出处 http://www.cnblogs.com/jostree/p/4080264.html 题目链接:hdu 4850 Wow! Such String! 欧拉回 ...
随机推荐
- play app to war
project/Build.scala import sbt._ import Keys._ import play.Play.autoImport._ import PlayKeys._ impor ...
- js获取页面元素距离浏览器工作区顶端的距离
先介绍几个属性:(暂时只测了IE和firefox,实际上我工作中用到的最多的是chrome) 网页被卷起来的高度/宽度(即浏览器滚动条滚动后隐藏的页面内容高度) (javascript) ...
- 左偏树(Leftist Heap/Tree)简介及代码
左偏树是一种常用的优先队列(堆)结构.与二叉堆相比,左偏树可以高效的实现两个堆的合并操作. 左偏树实现方便,编程复杂度低,而且有着不俗的效率表现. 它的一个常见应用就是与并查集结合使用.利用并查集确定 ...
- dp题目
从别的地方看来,最近一直在啃DP,有个目标,更有动力了. 1.Robberies 连接 :http://acm.hdu.edu.cn/showproblem.php?pid=2955 背包; ...
- Angularjs中编写指令模版
angular.module('moduleName', []).directive( 'namespaceDirectiveName', [ function() { return { restri ...
- C#程序中:如何向xml文件中写入数据和读取数据
xml文件作为外部信息存储文件使用简单,方便,其结构和表格略有相似,下面简单的说一下xml文件内容的读取 …… using System.Xml;using System.IO;namespace W ...
- Ext.Date 方法
1.Ext.Date.add(date,interval,value); 提供执行基本日期运算的简便方法; date 日期对象, interval 一个有效的日期间隔枚举值, value 向当前日期上 ...
- JavaScript学习心得(八)
Cookie是Netscape发明的技术,是动态网站必不可少的部分,用于浏览器请求Web页面的超文本传输协议是一种无状态的协议. 两种方法维护状态:使用会话(session)(使用服务器技术实现,数据 ...
- JS-运动框架
写这段代码,是因为之前看过某前RD写过,但在测试过程中发现有不完美的地方. 问题在于判断运动停止条件这里,对于之前停止的判断太片面,只能判断一个条件值时的情况,对于多条件时,会发现运动后的各项值并未达 ...
- CANoe 入门 Step by step系列(三)简单例子的剖析【转】
最好的学习方式是什么?模仿.有人会问,那不是山寨么?但是我认为,那是模仿的初级阶段,当把别人最好的设计已经融化到自己的血液里,变成自己的东西,而灵活运用的时候,才是真正高级阶段.正所谓画虎画皮难画骨. ...