2022年9月5日
摘要: 原文:https://blog.51cto.com/topic/pythonzifuchuanzhuanhuanchengshiliujinzhi.html 一,使用binascii模块 import binascii s=b'hello' a=binascii.b2a_hex(s) b=binas 阅读全文
posted @ 2022-09-05 16:01 RicLiu 阅读(492) 评论(0) 推荐(0) 编辑
  2022年9月3日
摘要: md5sum 文件名 阅读全文
posted @ 2022-09-03 23:27 RicLiu 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 这个模块需要安装 wget https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz 解压后 sage 阅读全文
posted @ 2022-09-03 23:15 RicLiu 阅读(50) 评论(0) 推荐(0) 编辑
  2022年9月1日
摘要: 格式:map(func,list) 将传入的函数变量func,传遍list的每个元素。并将结果组成新的列表返回。 阅读全文
posted @ 2022-09-01 15:36 RicLiu 阅读(23) 评论(0) 推荐(0) 编辑
摘要: matrix ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) ^ ( - 1 ) 得到: [ - 2 1 ] [ 3 / 2 - 1 / 2 ] 这是什么意思呢? 首先,这是一个二阶矩阵。 如图,右上角加-1,表示这是一个二阶矩阵求逆的计算式。 sage: A=Matrix([[1,2, 阅读全文
posted @ 2022-09-01 14:26 RicLiu 阅读(446) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> using namespace std; int main() { double r,m,y; cout << "***** 复利计算器 ****"<< endl; cout << "银行年利率:(%)" ; cin >> r; cout << "\r\n资金数 阅读全文
posted @ 2022-09-01 11:49 RicLiu 阅读(74) 评论(0) 推荐(0) 编辑
摘要: 1.int转string,函数to_string() x=10; string m=to_string(x); 经测试gcc v5.4.0版本不支持,版本v7.5.0支持。判断版本号命令:g++ -v 同样适用于double,float 2.string转int,函数atoi() string i= 阅读全文
posted @ 2022-09-01 10:50 RicLiu 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 1.变量类型判断函数typeid() int x=11; if(typeid(x)==typeid(int)) { cout << "int" << endl; } 可以判断int,string,double,char,Struct等类型和类 2.式样化输出函数printf() int x=11; 阅读全文
posted @ 2022-09-01 10:28 RicLiu 阅读(60) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; int main() { cout << "ok" << endl; return 0; } 编译命令:g++ x.cpp -o m 即可生成一个m的程序,使用./m运行 阅读全文
posted @ 2022-09-01 10:13 RicLiu 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 一、文件读取 FILE *f = fopen(addr, "rb"); // r for read, b for binary fread(pk, sizeof(pk), 1, f); fclose(f); fread()函数:从流中读取数据块 四个参数: 1.变量 2. 阅读全文
posted @ 2022-09-01 10:10 RicLiu 阅读(66) 评论(0) 推荐(0) 编辑