当前位置:网站首页>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;
}
边栏推荐
- 机器学习--手写英文字母1--分类流程
- 字符串匹配
- Uni app project directory, file function introduction and development specification
- SQL Server 2016 learning records - View
- Context values traps and how to avoid or mitigate these traps in go
- Huawei takes a 10% stake in fullerene technology, a graphene material manufacturer
- 20200229训练赛 L2 - 2 树种统计 (25分)
- 印度计划禁用中国电信设备!真离得开华为、中兴?
- SQL Server 2016学习记录 --- 单表查询
- Shortest path topic
猜你喜欢

SQL Server 2016 学习记录 --- 集合查询

数据库安全 --- 创建登录名 用户+配置权限【笔记】

Typora使用教程

Qt生成.exe文件 并 在无Qt环境下运行(Enigma Virtual Box进行绿色可执行软件封装)图文教程

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

Install Office customization. Troubleshooting during installation

SQL Server 2016 learning record - Data Definition

利用正则表达式从文件路径中匹配文件名

Idea create my first project

ACM寒假集训#6
随机推荐
管道、管程、管态的区别
5. Dynamic programming -- Fibonacci series
a different object with the same identifier value was already associated with the session
Database security - create login user + configure permissions [notes]
Netease written test No. 2 -- typical application of European distance
Idea create my first project
ACM winter vacation training 4
阿里云镜像地址
20200229训练赛 L1 - 2 删除字符串中的子串 (20分)
Step 4 - user development environment settings
[wechat applet] project practice - lottery application
ogg参数filter的使用问题【急】
Read write separation standby backup error
15. Judge whether the target value exists in the two-dimensional array
ACM寒假集训#7
试题 历届试题 发现环
ACM寒假集训#5
Codeforces Round #614 (Div. 2) B. JOE is on TV!
集群为什么需要root权限
django-celery-redis异步发邮件