HDU-4730 We Love MOE Girls
2016-07-18 14:09
211 查看
2016-07-16晚
题目大意:结尾有 desu 的替换为 nanodesu,没有的直接在末尾加上 nanodesu
解题思路:检测覆盖
HDU-4730 We Love MOE Girls
题目大意:结尾有 desu 的替换为 nanodesu,没有的直接在末尾加上 nanodesu解题思路:检测覆盖
#include <iostream> #include <cstring> #include <cstdio> using namespace std; char str[10000]; char _str[10000]; int main() { int T; int t; cin >> T; for (t = 1; t <= T; t++) { memset( str , '\0' , sizeof(str) ); memset( _str , '\0' , sizeof(_str) ); cin >> str; if ( strstr(str,"desu") && (strstr(str ,"desu")-str+4) == strlen(str)) { strncpy( _str , str , strstr(str , "desu")-str ); strcat(_str , "nanodesu"); strcpy(str , _str); } else strcat(str , "nanodesu"); cout << "Case #" << t << ": " << str << endl; } return 0; }
相关文章推荐
- R语言实战笔记(一)
- (17)事务和并发
- T树索引的学习与实现(二)
- DWR入门教程(http://www.cnblogs.com/cyjch/archive/2012/02/16/2353758.html)
- jzoj 1400. 【2012.03.09普及组】骰子
- CodeForces-567B Berland National Library
- Java中equals和==的区别
- Android-jar包的重新打包
- SQLHelper的使用
- 删除python读取的txt每一行尾部的\n
- 为什么Redis内存不宜过大
- OpenCV与EmguCV中的图像轮廓提取
- thread::hardware_concurrency()
- PS抠图神器!两个实例帮你彻底掌握「调整边缘」的逆天功能
- JIRA Service Desk获得 ITIL 认证
- springMVC配置文件
- GitHub Open Source For iOS
- restful
- Android漂亮的对话框项目sweet-alert-dialog
- GitHub上那些值得一试的JAVA开源库--转