摘要: #include #define N 10 #define MIN(X,Y) ((X<Y)?(X):(Y)) int f(int arr[],int len,int n) { if(n == len-1) return arr[n]; int min = f(arr,len,n+1); ... 阅读全文
posted @ 2018-11-23 21:32 anobscureretreat 阅读(1696) 评论(0) 推荐(0)
摘要: #include #define PI 3.14 using namespace std; class Circle { float radius; public: void getRadius(); float area(); void showRadius(); }; void Circle :: getRadius() { cout > ra... 阅读全文
posted @ 2018-11-23 21:19 anobscureretreat 阅读(2053) 评论(0) 推荐(0)
摘要: #include #include using namespace std; class stringfun { char name[20]; public: void concatString(char a[],char b[]) { strcat(a," "); strcat(a,b); ... 阅读全文
posted @ 2018-11-23 21:13 anobscureretreat 阅读(1863) 评论(0) 推荐(0)
摘要: import yaml yaml_dict={"sss":"111","ddd":"222"} with open("a.yaml", "w") as f: yaml.safe_dump(yaml_dict,f,encoding='utf-8', allow_unicode=True) with open("a.yaml") as f: yaml_dict = yaml.l... 阅读全文
posted @ 2018-11-23 19:00 anobscureretreat 阅读(388) 评论(0) 推荐(0)
摘要: >>> 'spam eggs' # single quotes 'spam eggs' >>> 'doesn\'t' # use \' to escape the single quote... "doesn't" >>> "doesn't" # ...or use double quotes instead "doesn't" >>> '"Yes," 阅读全文
posted @ 2018-11-23 17:07 anobscureretreat 阅读(219) 评论(0) 推荐(0)
摘要: >>> letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] >>> letters ['a', 'b', 'c', 'd', 'e', 'f', 'g'] >>> # replace some values >>> letters[2:5] = ['C&# 阅读全文
posted @ 2018-11-23 16:54 anobscureretreat 阅读(6306) 评论(0) 推荐(0)
摘要: >>> a = ['a', 'b', 'c'] >>> n = [1, 2, 3] >>> x = [a, n] >>> x [['a', 'b', 'c'], [1, 2, 3]] >>> x[0] ['a', 'b', 'c'] >>> x[0][1] 'b' 阅读全文
posted @ 2018-11-23 16:50 anobscureretreat 阅读(204) 评论(0) 推荐(0)
摘要: 第一个元素一定是最小的,如果每次只想拿到列表的最小值,不想整个列表排序,可以通过不断返回最小值的方法实现 阅读全文
posted @ 2018-11-23 16:29 anobscureretreat 阅读(150) 评论(0) 推荐(0)
摘要: import zipfile import os,shutil import openpyxl file_list_pos="" fileName="" zipfileName="" def un_zip(file_name): """unzip zip file""" zip_file = zipfile.ZipFile(file_name) if o... 阅读全文
posted @ 2018-11-23 16:06 anobscureretreat 阅读(1048) 评论(0) 推荐(0)
摘要: 在当前路径解压zip压缩包,生成同名文件夹,内部目录结构与压缩包一致 阅读全文
posted @ 2018-11-23 16:04 anobscureretreat 阅读(5047) 评论(0) 推荐(0)
摘要: import zipfile file_name="a.txt" f = zipfile.ZipFile('test.zip','w',zipfile.ZIP_STORED) f.write(file_name) f.close() 阅读全文
posted @ 2018-11-23 15:47 anobscureretreat 阅读(2809) 评论(0) 推荐(0)
摘要: 输出 阅读全文
posted @ 2018-11-23 14:51 anobscureretreat 阅读(800) 评论(0) 推荐(0)
摘要: import glob x=glob.glob('*.py') print(x) 阅读全文
posted @ 2018-11-23 11:01 anobscureretreat 阅读(3735) 评论(0) 推荐(0)