当前位置:网站首页>20200217 training match L1 - 7 2019 is coming (20 points)
20200217 training match L1 - 7 2019 is coming (20 points)
2022-07-28 10:33:00 【Xiaoliu xuezha】
Judge number sequence S Whether it is composed of several 2019 Spliced .
Input format :
Each line gives a length of n A sequence of numbers ( By digital 0~9 form , There are no other characters in the middle , length n<80).
Output format :
For a sequence of numbers , Give the judgment result “Yes” or “No”. Each output takes up one line .
sample input :
20192019
201920
sample output :
Yes
No
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
while(getline(cin,s))
{
while(s.substr(0,4)=="2019")//substr(a,b), from a Start , The intercept length is b String
{
s.erase(0,4);// from a Start , The deletion length is b
}
if(s.length()==0)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}
边栏推荐
猜你喜欢

Inverse element & combinatorial number & fast power

C语言 二级指针详解及示例代码

11. Linked list inversion

SQL Server 2016 learning records - data update

SQL Server 2016 learning record - Data Definition

15. Judge whether the target value exists in the two-dimensional array

多线程与高并发(三)—— 源码解析 AQS 原理

gcc: error trying to exec 'as': execvp: No such file or directory

Idea packages jar packages and runs jar package commands

Django celery redis send email asynchronously
随机推荐
Codeforces Round #614 (Div. 2) B. JOE is on TV!
在mt6735中添加新的开机logo与开\关机动画
SQL Server 2016学习记录 --- 单表查询
gcc: error trying to exec 'as': execvp: No such file or directory
简介
How to write Ogg with multiple filter syntax?
Detailed explanation of super complete knowledge points of instruction system
KingbaseES V8R6 JDBC 能否使用VIP ?
利用正则表达式从文件路径中匹配文件名
[wechat applet] project practice - lottery application
AP Autosar平台设计 1-2 导言、技术范围与方法
Implement a queue with two stacks [C language]
Bitwise and, or, XOR and other operation methods
管道、管程、管态的区别
上下文变量值(context values)陷阱及在 Go 中如何避免或缓和这些陷阱
7. Dichotomy -- find a set of repeated or ordered but rotating arrays
Sword finger offer
SQL Server 2016 学习记录 --- 嵌套查询
Qt生成.exe文件 并 在无Qt环境下运行(Enigma Virtual Box进行绿色可执行软件封装)图文教程
问题总结档案