杭电2024题
2016-04-21 18:48
92 查看
#include<iostream>#include<string>using namespace std;int main(){ int n; while (cin >> n&&n) { getchar(); for (int i = 1; i <= n; i++) {char a[50]; cin.getline(a, 50); int count=0,sum=0,count1=0,count2=0,count3=0,count4=0; for (int j = 0; j < strlen(a); j++) { if ('0' <= a[0] && a[0] <= '9'){ count = 0; break; } if (a[j] == ' ') { count = 0; break; } if (('0' <= a[j] && a[j] <= '9')) count1++; if (('a' <= a[j] && a[j] <= 'z'))count2++; if (('A' <= a[j] && a[j] <= 'Z'))count3++; if ((a[j] == '_'))count4++; count = count1 + count2 + count3 + count4; }if (count== strlen(a)) cout << "yes" << endl; else cout << "no" << endl; } }return 0;
}
}
相关文章推荐
- MyBatis springboot gradle 开发配置
- 杭电2040 亲和数
- 杭电 2021题 发工资咯:)
- 杭电2018 母牛故事
- 杭电2036题
- 杭电2031题
- 杭电2027题
- Activity通信之返回数据
- 2013 - Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- strcmp()
- mvn常用命令
- iOS load和initialize方法加载顺序测试结果
- 《Maven权威指南》学习笔记二十一_构建生命周期
- 四大组件的区别与联系
- Welcome to the Black Parade——关注代码背后的知识
- 个人工作总结3
- 20145127《java程序设计》第八周学习总结
- 4、Jenkins 使用maven构建一个项目
- javascript入门篇之基础语法
- jQuery 监控键盘一段时间内没输入