Python读数据
import sys
while True:
line = sys.stdin.readline()
Python字典排序
# 按照value从大到小排序
dict = sorted(dict.items(), key=lambda x:x[1], reverse=True)
在Python 类中递归调用的时候, 一定要是
self.func
, 要不然会发生func
未定义的报错
C++逗号分隔符读取
// 比如输入: abcdef,gh,ijk
// 分别读入到s, s1, s2中
string s, s1, s2;
char c;
while(cin >> c && c != ',') s += c;
while(cin >> c && c != ',') s1 += c;
while(cin >> c) s2 += c;