//http://poj.org/problem?id=2117 #include #include #include #include #define N 10005 void read(int &x) { x=0; char ch=getchar(); for(;!isdigit(ch);ch=... ...
分类:
其他好文 时间:
2017-07-21 23:26:36
阅读次数:
365
#include #include #define N 200010 void read(int &x) { x=0; char ch=getchar(); while(!isdigit(ch)) ch=getchar(); while(isdigit(ch)) {x=x*10+ch-'0';ch=... ...
分类:
其他好文 时间:
2017-07-16 22:37:35
阅读次数:
227
#include <ctype.h> #include <cstdio> #define N 10000050 void read(int &x) { x=0;bool f=0; char ch=getchar(); while(!isdigit(ch)) {if(ch=='-') f=1;ch=g ...
分类:
其他好文 时间:
2017-07-12 21:21:17
阅读次数:
125
定义及特性:以引号(单引号,双引号,三引号)包围且不能修改a=‘\taBcdEfgFijDlmNopqrStuTwxyz123!@#\t‘一、判断字符串,返回bool值:False或Trueprint(a.isidentifier())#判断是否可以作为标识符/变量使用
print(a.isdigit())#判断是否全为整数型
print(a.isalpha())#判断是..
分类:
编程语言 时间:
2017-07-04 13:35:17
阅读次数:
193
//校验是否全由数字组成 function isDigit(s) { var patrn=/^[0-9]{1,20}$/; if (!patrn.exec(s)) return false return true } //校验登录名:只能输入5-20个以字母开头、可带数字、“_”、“.”的字串 Ja ...
分类:
Web程序 时间:
2017-07-01 12:42:54
阅读次数:
238
shoplist = [] product_list = [ ('computer',5000), ('apple',50), ('book',42), ('iphone',6800) ] salary = input("输入您的工资:") if salary.isdigit(): salary =... ...
分类:
其他好文 时间:
2017-07-01 00:12:58
阅读次数:
203
defbona():
whileTrue:
n=(input(‘你想打印几个数的斐波那契数列:‘))
ifnotn.isdigit():
exit()
a,b,m=0,1,0
n=int(n)
A=‘‘
whilem<n:
a,b=b,a+b
m+=1
A=‘‘‘%s%s‘‘‘%(A,str(a))
else:
print(A)
bona()
分类:
其他好文 时间:
2017-06-26 22:31:30
阅读次数:
146
1.字符串string 推断一个字符(char)是数字还是字母 str.isalpha() #推断是否为字母 str.isdigit() #推断是否为数字 推断一个字符串是否为空 if not str.strip(): #推断是否为空,true表示空 向字符串加入内容 str = ''.join(' ...
分类:
编程语言 时间:
2017-06-24 18:32:49
阅读次数:
149
搜索水题 哎 直接不行了 。 #include <ctype.h> #include <cstdio> void read(int &x) { x=0;char ch=getchar(); while(!isdigit(ch)) ch=getchar(); while(isdigit(ch)) {x ...
分类:
其他好文 时间:
2017-06-07 15:39:48
阅读次数:
172
1.大小写转换 判断字符串 s.isalnum() #所有字符都是数字或者字母 s.isalpha() #所有字符都是字母 s.isdigit() #所有字符都是数字 s.islower() #所有字符都是小写 s.isupper() #所有字符都是大写 s.istitle() #所有单词都是首字母 ...
分类:
编程语言 时间:
2017-06-05 10:30:06
阅读次数:
155