A. Vicious Keyboard
来源:互联网 发布:linux 文件夹重命名 编辑:程序博客网 时间:2024/05/22 03:09
题目地址
题意
一个人有一个键盘 只能打V和K 然后他很喜欢VK 然后他还能在打完之后任意修改一个字符问你最多有多少个VK
代码
#include<cstdio>#include<cstring>int main(){ int vk = 0; int el; char str[200]; scanf("%s",str); for(int i=0;i<strlen(str);i++) { if(i>0&&str[i]=='K'&&str[i-1]=='V') { vk++; str[i-1]='0'; str[i]='0'; } } for(int i=0;i<strlen(str);i++) { if(i>0&&((str[i-1]=='V'&&str[i]=='V')||(str[i-1]=='K'&&str[i]=='K'))) { vk++; break; } } printf("%d\n",vk); return 0;}
提交时间 2017.11.7
阅读全文
0 0
- A. Vicious Keyboard
- A. Vicious Keyboard codeforce
- A. Vicious Keyboard
- A. Vicious Keyboard
- A. Vicious Keyboard Codeforce
- Codeforces 801A Vicious Keyboard
- CodeForces 801A Vicious Keyboard
- codeforces 801A Vicious Keyboard
- CodeForces 801A Vicious Keyboard 模拟
- Codeforces Round #409 (Div. 2) A. Vicious Keyboard
- CF#801 A. Vicious Keyboard(字符串,水题)
- Codeforces801A Vicious Keyboard
- Codeforces801A Vicious Keyboard
- Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2) A. Vicious Keyboard
- 0519 G2n#W2B-B Vicious Keyboard
- CF Vicious Keyboard 构造水题
- CF-Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2)-A-Vicious Keyboard
- A. Keyboard
- Hadoop1.*中MapReduce的partitioner源码分析
- jquery字符串转数组
- 初识SOAP------第一天
- python学习笔记——列表copy
- ceph-deploy error
- A. Vicious Keyboard
- 第五周项目二C/C++数据结构之自建算法库——链栈
- 线程 多线程
- 百度地图api实现路线规划之步行驾车
- Java 520.1314表白
- 最短路大全
- React学习笔记_React-Redux 的用法
- 20171107_VMware12_ubuntu16.04.3LTS_英文版安装中文输入法ibus
- 【Mybatis学习】Mybatis映射器