http://noi.openjudge.cn/ch0107/06/

"""1.7编程基础之字符串 06 合法 C 标识符
http://noi.openjudge.cn/ch0107/06/"""import syss=input()if not ((s[0]<='z'and s[0]>='a') or (s[0]=='_') or (s[0]<='Z' and s[0]>='A')):print("no")sys.exit(0)for i in range(0,len(s)):if s[i]<='z'and s[i]>='a' or s[i]=='_' or s[0]<='Z' and s[i]>='A' or s[i]<='9' and s[i]>='0':continueelse:print("no")sys.exit(0)
print("yes")

C++代码:

#include<bits/stdc++.h>
using namespace std;
int main()
{string s;getline (cin ,s);if((s[0]<='z'&&s[0]>='a')||(s[0]=='_')||(s[0]<='Z'&&s[0]>='A')){;}else {cout<<"no";return 0;}for(int i=0;i<s.size();i++){if((s[i]<='9'&&s[i]>='0')||(s[i]<='z'&&s[i]>='a')||(s[i]=='_')||(s[i]<='Z'&&s[i]>='A')){continue;}else {cout<<"no";return 0;}}cout<<"yes";return 0;
}

1.7编程基础之字符串 06 合法 C 标识符 python相关推荐

  1. 1.7 编程基础之字符串 34 回文子串 python

    http://noi.openjudge.cn/ch0107/34/ """1.7 编程基础之字符串 34 回文子串 http://noi.openjudge.cn/ch ...

  2. 1.7 编程基础之字符串 14 大小写字母互换 python

    http://noi.openjudge.cn/ch0107/14/ """1.7 编程基础之字符串 14 大小写字母互换 AC http://noi.openjudge ...

  3. 1.7-06编程基础之字符串 字符翻转

    1.7编程基础之字符串 06:合法 C 标识符 总时间限制: 1000ms 内存限制: 65536kB 描述 给定一个不包含空白符的字符串,请判断是否是C语言合法的标识符号(注:题目保证这些字符串一定 ...

  4. 1.7 编程基础之字符串 30 字符环 python

    http://noi.openjudge.cn/ch0107/30/ """ 1.7 编程基础之字符串 30 字符环 http://noi.openjudge.cn/ch ...

  5. 1.7 编程基础之字符串 31 字符串p型编码 python

    http://noi.openjudge.cn/ch0107/31/ """ 1.7 编程基础之字符串 31 字符串p型编码 http://noi.openjudge.c ...

  6. 1.7 编程基础之字符串 32 行程长度编码 python

    http://noi.openjudge.cn/ch0107/32/ """ 1.7 编程基础之字符串 32 行程长度编码 http://noi.openjudge.cn ...

  7. 1.7 编程基础之字符串 33 判断字符串是否为回文 python

    http:// http://noi.openjudge.cn/ch0107/33/ """1.7 编程基础之字符串 33 判断字符串是否为回文http://noi.op ...

  8. 1.7 编程基础之字符串 27 单词翻转 4分 python

    """ 1.7 编程基础之字符串 27 单词翻转 4分 http://noi.openjudge.cn/ch0107/24/ https://blog.csdn.net/ ...

  9. 1.7 编程基础之字符串 25 最长最短单词 python

    """ 1.7 编程基础之字符串 25 最长最短单词 http://noi.openjudge.cn/ch0107/25/ https://blog.csdn.net/h ...

最新文章

  1. Android插件化原理解析——概要
  2. CVPR 2019 ATOM:《ATOM: Accurate Tracking by Overlap Maximization》论文笔记
  3. 如何替公司省下数千万勒索费用
  4. 如何用cocos2d-x来开发简单的Uphone游戏:(二) 移动的精灵
  5. 90 % Java 程序员被误导的一个性能优化策略
  6. 试编写算法,设任意n个整数存放于数组A[1...n]中,将所有正数排在所有负数前面(要求:算法时间复杂度为O(n))
  7. java 时间的相关转换操作
  8. OpenStack精华问答 | OpenStack的目标是什么?
  9. 解决IDEA中maven搭建web项目,在maven中有依赖但是在部署包中生成不出依赖
  10. 50 Fast Flash MX Techniques
  11. win7计算机摄像头怎么打开,告诉你win7如何打开摄像头
  12. php懂erp是什么意思,ERP是个什么鬼,这里的讲解通俗易懂
  13. 第一天 Java基础入门【悟空教程】
  14. 红色警戒最新版本哪个服务器好,红色警戒2里面哪个版本最好玩?
  15. java-php-python-ssm新生报到管理系统计算机毕业设计
  16. uploadify 2.1.0 java spring mvc 2003版excel 附件上传
  17. cf1064E. Dwarves, Hats and Extrasensory Abilities(二分 交互)
  18. 什么是Tower,Rack, blade服务器?
  19. 什么是Subversion?
  20. 提交一个骗子喵喵源码站

热门文章

  1. 背水一战 Windows 10 (55) - 控件(集合类): SemanticZoom, ISemanticZoomInformation
  2. 黄聪:ThinkSAAS开发文档 常用函数 模版修改
  3. Visual Studio中相对路径中的宏定义,你不了解的宏定义都在这里!
  4. 【java】Windows7 下环境变量设置
  5. 今天的我从来没想到的飞鸽传书2009
  6. 除了陈真处外的深圳论坛SZ4J
  7. 没事研究下C#虚拟光驱,有所收获!
  8. Sound recording and encoding in MP3 format.
  9. 创业失败常见的8大原因
  10. 跨进程实现在Tree中快速定位节点