摘要:
格式:map(func,list) 将传入的函数变量func,传遍list的每个元素。并将结果组成新的列表返回。
阅读全文
posted @ 2022-09-01 15:36
RicLiu
阅读(23)
推荐(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)
编辑
摘要:
#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)
编辑
摘要:
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)
编辑
摘要:
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)
编辑
摘要:
#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)
编辑
摘要:
一、文件读取 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)
编辑