当前位置:网站首页>L1-070 eating hot pot (15 points)
L1-070 eating hot pot (15 points)
2022-04-23 00:06:00 【WTXYL】
It's basically useless for you to call me if you have something bad in this weather . But if you say “ Eat hot pot ”, That's great , Our story begins .
This problem requires you to implement a program , Automatically check if there is any in the message sent to you by your friend chi1 huo3 guo1.
Input format :
Each line of input gives a sentence that does not exceed 80 A character 、 Friend information ending with carriage return , The information is a non empty string , Just letters 、 Numbers 、 Space 、 Visible half angle punctuation . When you read a line with only one English period . when , End of input , This trip is not included in the friend information .
Output format :
First, output the total number of friend information in one line . Then to each line of information of friends , Check if it contains chi1 huo3 guo1, And count how many pieces of such powerful information . In the second line, first output the first occurrence chi1 huo3 guo1 What is your message ( from 1 Start counting ), Then output the total number of such information , Separated by a space . The title ensures that all numbers output do not exceed 100.
If a friend doesn't mention it from beginning to end chi1 huo3 guo1 Keyword , Then output an expression on the second line -_-#.
sample input 1:
Hello!
are you there?
wantta chi1 huo3 guo1?
that's so li hai le
our story begins from chi1 huo3 guo1 le
.
sample output 1:
5
3 2
sample input 2:
Hello!
are you there?
wantta qi huo3 guo1 chi1huo3guo1?
that's so li hai le
our story begins from ci1 huo4 guo2 le
.
sample output 2:
5
-_-#
Code :
#include <iostream>
#include <string>
using namespace std;
int main(){
int cnt = 0, firstP = -1, res = 0;
string s;
while(1){
getline(cin, s);
if(s.size() == 1 && s[0] == '.') break;
cnt ++;
if(s.find("chi1 huo3 guo1") != -1){
res ++;
if(firstP == -1) firstP = cnt;
}
}
cout << cnt << endl;
if(res == 0) cout << "-_-#" << endl;
else cout << firstP << " " << res << endl;
}
版权声明
本文为[WTXYL]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204222219282075.html
边栏推荐
- 样本不均衡的问题
- 编程2022-02 KTV
- 条码WMS系统与ERP接口实现方法
- SystemVerilog verification - Test Platform preparation guide learning notes (0): introduction to verification
- Write a beautiful login page with fluent (latest version)
- 庞加莱球模型
- 微信小程序页面跳转
- Architecture of bar code WMS system
- WMS系统与ERP仓储管理的差异
- Detailed explanation of seven common query connections in MySQL
猜你喜欢

YASKAWA motor servo software sigmawin + cannot be connected to the servo driver

WMS仓储管理系统解决方案

ssh: connect to host 172.31.8.132 port 22: Connection refused

OpenCV中保存不同深度图像的技巧

B端/C端中,产品or运营哪个更重要?

Skills of saving images with different depths in opencv

stm32f103 独立看门狗

Reinstall windows10

SystemVerilog verification - Test Platform preparation guide learning notes (5): function coverage

【ACM】78. 子集(返回所有节点的元素,不用设置终止条件)
随机推荐
PHP one-dimensional array de duplication
pycharm界面改为中文,中英文切换
SystemVerilog verification - Test Platform writing guide learning notes (3): connecting design and test platform
解决工业缺陷检测小样本问题
WMS warehouse management system solution
算法--两数相加 II(Kotlin)
80386 compilation_ Introduction to global description table GDT
闭包的实现原理和作用、以及内存泄露
English pronunciation and notes commonly used in OC
获取当前选中字符串的范围
stm32f103 独立看门狗
SystemVerilog verification - Test Platform preparation guide learning notes (0): introduction to verification
Basic use of redis
Character set (de duplication)
ssh: connect to host 172.31.8.132 port 22: Connection refused
Day81 (dynamic programming, cross tree traversal)
STM32F103 independent watchdog
【ACM】78. 子集(返回所有节点的元素,不用设置终止条件)
[gestion des transactions]
Redis的基本使用