会员
众包
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
littleboss
学习是一场痛苦且充满了希望的渡劫
博客园
首页
新随笔
联系
订阅
管理
1
2
下一页
2024年5月29日
使用shell脚本替换csv文件中的数据
摘要: [observer@xxx-grey-openresty test]$ cat file.csv beijing,beijing,lisi,10 shanxi,xian,tom,6 shanghai,shanghai,xiaoming,3 guangdong,guangzhou,wangwu,8 s
阅读全文
posted @ 2024-05-29 17:34 进取
阅读(0)
评论(0)
推荐(0)
编辑
2024年3月11日
shell 给字符串增加单引号,并移除字符串中多余的空格
摘要: 用到的命令: echo 输出字符串 tr 常用于处理字符串间隔,例如将空格分割替换为逗号分割;删除多个连续的空格等等 sed 也是用于字符串处理。如字符串替换,也可做字符串删除 awk 也用于字符串处理。如将字符串按照空格等分隔符,分成好几列,按需输出某一列的值;字符计数,统计次数;复杂的字符串处理
阅读全文
posted @ 2024-03-11 15:29 进取
阅读(42)
评论(0)
推荐(0)
编辑
2022年10月26日
文件读写
摘要: 实现文件写入 #include<iostream> #include<fstream> using namespace std; void main() { fstream wfs("test5.txt", ios::out); if(!wfs) cout << "打开文件失败" << endl;
阅读全文
posted @ 2022-10-26 21:34 进取
阅读(18)
评论(0)
推荐(0)
编辑
计算中文在内存占用的字节数
摘要: #include<iostream> using namespace std; void main() { // 功能: 计算 中文在内存占用的字节数 char name[] = "成都"; char node_name[] = "成都移动04节点"; cout << "int占用:" << siz
阅读全文
posted @ 2022-10-26 21:17 进取
阅读(46)
评论(0)
推荐(0)
编辑
判断是不是闰年
摘要: 闰年计算方法: 能被400整除。 能被4整除,不能被100整除。 #include<iostream> using namespace std; class Sample { private: int x; public: Sample() {} Sample(int a) {x=a;} void
阅读全文
posted @ 2022-10-26 21:08 进取
阅读(43)
评论(0)
推荐(0)
编辑
纯虚函数
摘要: #include<iostream> using namespace std; const double Pi = 3.14; class Shape { public: virtual void draw() = 0; }; class Cicle:public Shape { public: v
阅读全文
posted @ 2022-10-26 21:03 进取
阅读(22)
评论(0)
推荐(0)
编辑
实现两个矩阵做加法运算
摘要: #include<iostream.h> class mix { public: mix(); friend mix operator+(mix &c1,mix &c2); void input(); void display(); private: int m[2][3]; }; mix::mix
阅读全文
posted @ 2022-10-26 20:58 进取
阅读(70)
评论(0)
推荐(0)
编辑
运算符重载
摘要: #include<iostream> using namespace std; class Complex { public: Complex() {real=0;imag=0;} Complex(double r,double i) {real=r;imag=i;} double get_real
阅读全文
posted @ 2022-10-26 20:48 进取
阅读(14)
评论(0)
推荐(0)
编辑
通过类的公用方法操作类的私有成员
摘要: #include<iostream> using namespace std; class goods { public: goods() {total =0;} void get_toal() { cout << "当前货物总量 total = " << total << endl; } doub
阅读全文
posted @ 2022-10-26 20:46 进取
阅读(14)
评论(0)
推荐(0)
编辑
c++当中的引用
摘要: 引用 在c++中,我们有一种比传递指针更加高效的方式,那就是引用(Reference)。 引用类似于windows环境下的快捷方式,通过快捷方式和可执行程序本身都可以运行程序。 引用的定义方式类似于指针,只不过使用的 "&" 代替了 "*" 。 void main() { int a = 9; in
阅读全文
posted @ 2022-10-26 20:38 进取
阅读(28)
评论(0)
推荐(0)
编辑
1
2
下一页