[APIO2016]划艇 思路: "参考这里" 源代码: cpp include include include include inline int getint() { register char ch; while(!isdigit(ch=getchar())); register int x ...
一、同步与异步同步/异步, 它们是消息的通知机制1. 概念解释A. 同步所谓同步,就是在发出一个功能调用时,在没有得到结果之前,该调用就不返回。按照这个定义,其实绝大多数函数都是同步调用(例如sin isdigit等)。但是一般而言,我们在说同步、异步的时候,特指那些需要其他部件协作或者需要一定时间 ...
分类:
其他好文 时间:
2018-08-10 23:10:48
阅读次数:
94
Character.isDigit(string.charAt(index)) //如果index位置的字符是数字 返回true Character.isLetter(string.charAt(index)) //如果index位置的字符是字母 返回true Character.isLetterO ...
分类:
编程语言 时间:
2018-08-06 21:04:18
阅读次数:
150
expandtabs(): # \t为制表符,\n为换行。断句20 test="1234567\t89" v=test.expandtabs(20) print(v,len(v)) isdecimal(): #当前输入的是不是数字 isdigit(): #当前输入的是不是数字 isnumeric() ...
分类:
编程语言 时间:
2018-08-06 17:52:43
阅读次数:
144
POI2011 Tree Rotations 给定一个n include using namespace std; typedef long long LL; inline void read(int &x){ char ch; x=0; for (; ch=getchar(), !isdigit( ...
分类:
其他好文 时间:
2018-08-05 11:49:21
阅读次数:
155
str为字符串s为字符串 str.isalnum() 所有字符都是数字或者字母 str.isalpha() 所有字符都是字母 str.isdigit() 所有字符都是数字 str.isspace() 所有字符都是空白字符、\t、\n、\r 检查字符串是数字/浮点数方法 float部分 第一种:最简单 ...
分类:
编程语言 时间:
2018-08-02 20:43:40
阅读次数:
209
在接收raw_input方法后,判断接收到的字符串是否为数字 例如: str = raw_input("please input the number:") if str.isdigit(): 为True表示输入的所有字符都是数字,否则,不是全部为数字 str为字符串str.isalnum() 所有 ...
分类:
编程语言 时间:
2018-07-29 14:19:42
阅读次数:
149
解压:
a,b,c,d=f(同上)
不要中间的值:
a,_,_,b=f
a,*_,b=f()
"_"为一个不使用的值
"*_"为n个不使用的值
赋值运算:
le=1
le+1=1 等于 le=le+1 (适合所有运算符)
逻辑:
and(与),or(或),not(非,只实现紧跟它后的判断)
print(not 3 > 4 )
判断值是否相等:"=="
判断id时否相等:"is"
if格式:
if 判断语句 :
执行语句
else:
执行语句
多if:
if 判断语句 :
if 判断语句 :
执行语句
else:
执行语句
else:
执行语句
例:
input(‘score>>‘)
if score.isdigit(): #isdigit()判断变量是否为纯数字
score=int(score) #int只能转换整型类型
elif score>=90 :
print(‘优秀‘)
elif score>=80 :
print(‘良好‘)
elif sc
分类:
编程语言 时间:
2018-07-26 23:45:46
阅读次数:
302
isdigit() 判断字符串是否由数字组成 join() 返回通过指定字符连接序列中元素后生成的新字符串 ...
分类:
编程语言 时间:
2018-07-26 18:24:30
阅读次数:
124
排座椅: #include using namespace std; inline int read(){ int num=0,f=1; char c=getchar(); while(!isdigit(c)){if(c=='-') f=-1; c=getchar();} while(isdigit... ...
分类:
其他好文 时间:
2018-07-16 22:14:31
阅读次数:
153