摘要:
格式:map(func,list) 将传入的函数变量func,传遍list的每个元素。并将结果组成新的列表返回。 阅读全文
摘要:
matrix ( [ [ 1 , 2 ] , [ 3 , 4 ] ] ) ^ ( - 1 ) 得到: [ - 2 1 ] [ 3 / 2 - 1 / 2 ] 这是什么意思呢? 首先,这是一个二阶矩阵。 如图,右上角加-1,表示这是一个二阶矩阵求逆的计算式。 sage: A=Matrix([[1,2, 阅读全文
摘要:
#include<iostream> using namespace std; int main() { double r,m,y; cout << "***** 复利计算器 ****"<< endl; cout << "银行年利率:(%)" ; cin >> r; cout << "\r\n资金数 阅读全文
摘要:
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= 阅读全文
摘要:
1.变量类型判断函数typeid() int x=11; if(typeid(x)==typeid(int)) { cout << "int" << endl; } 可以判断int,string,double,char,Struct等类型和类 2.式样化输出函数printf() int x=11; 阅读全文
摘要:
#include <iostream> using namespace std; int main() { cout << "ok" << endl; return 0; } 编译命令:g++ x.cpp -o m 即可生成一个m的程序,使用./m运行 阅读全文
摘要:
一、文件读取 FILE *f = fopen(addr, "rb"); // r for read, b for binary fread(pk, sizeof(pk), 1, f); fclose(f); fread()函数:从流中读取数据块 四个参数: 1.变量 2. 阅读全文
摘要:
vi编辑状态,按下ctrl+z键后,被挂起。显示: [2]+ Stopped vi verify2.sage 此时,再vi该文件,则出现错误提示: E325: ATTENTION Found a swap file by the name ".verify2.sage.swp" owned by: 阅读全文