码迷,mamicode.com
首页 >  
搜索关键字:isdigit    ( 345个结果
单调队列
#include using namespace std; void qin(int &aaa){ char c=getchar(); int ans=0,flag=1; while(!isdigit(c)){ if(c=='-')flag=-flag;c=getchar(); } while(is... ...
分类:其他好文   时间:2017-09-10 18:57:34    阅读次数:177
python1加到n
1 while True: 2 a = 0 3 n = input('从0开始加到您所输入的数字:') 4 if n.isdigit() == True: 5 n = int(n) 6 for i in range(n+1): 7 a += i 8 else: 9 ... ...
分类:编程语言   时间:2017-09-10 10:05:45    阅读次数:177
Python判断字符串是否为字母或者数字
严格解析:有除了数字或者字母外的符号(空格,分号,etc.)都会Falseisalnum()必须是数字和字母的混合isalpha()不区分大小写 str_1 = "123" str_2 = "Abc" str_3 = "123Abc" #用isdigit函数判断是否数字 print(str_1.is... ...
分类:编程语言   时间:2017-08-30 21:38:44    阅读次数:175
python第二话
salary.isdigit() 判断 下断点调试 for和else组合 ...
分类:编程语言   时间:2017-08-11 22:07:36    阅读次数:134
少女折寿中
/* 快速乘法 */ #include #include void read (long long &now) { register char word = getchar (); for (now = 0; !isdigit (word); word = getchar ()); for (; i... ...
分类:其他好文   时间:2017-08-08 23:00:05    阅读次数:382
未完成
#include #include typedef long long LL; void read(LL &x) { x=0;bool f=0; register char ch=getchar(); for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=1; ... ...
分类:其他好文   时间:2017-08-08 22:54:45    阅读次数:133
Python之字符串
字符串常用方法s.find()s.join()s.split()s.replace()s.strip()s.isalnum()/s.isalpha()/s.isdigit()s.upper()/s.lower()s.count()len(s)1.序列类型常用操作a)索引和切片索引:例:s[0]从左向右:索引从0开始;从右向左:索引从-1开始切片:例:s[0:2]实例:实例:扩展..
分类:编程语言   时间:2017-08-03 09:52:52    阅读次数:203
【模板】读入优化
#include<cstdio> //调用cstdio库,使用getchar函数 #include<cctype> //调用cctype库,使用isdigit函数,返回参数是否为整数 inline int get_num() { //内联get_num函数,读入整数 int num = 0; //定 ...
分类:其他好文   时间:2017-07-31 10:04:53    阅读次数:231
简单函数练习
1、写函数,计算传入字符串中【数字】、【字母】、【空格] 以及 【其他】的个数 def func(s): dic = { 'num':0, 'alpha':0, 'space':0, 'other':0 } for i in s: #item 项 if i.isdigit(): ... ...
分类:其他好文   时间:2017-07-26 20:20:29    阅读次数:108
python第11天作业
#、写函数,计算传入字符串中【数字】、【字母】、【空格] 以及 【其他】的个数def count(s): nu,st,sp,it = 0,0,0,0 for i in s: if i.isdigit(): nu += 1 elif i.isalpha(): st += 1 elif i.isspac ...
分类:编程语言   时间:2017-07-25 18:07:08    阅读次数:173
345条   上一页 1 ... 19 20 21 22 23 ... 35 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!