自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(43)
  • 收藏
  • 关注

原创 python 遍历从重命名文件夹下的所有文件

收到一个文件包,里面的文件命名是1.png、2.png……但在手机上打开时,是按1/10/11/12这样排序的,不是按数字从小到大。因此,需要将所有的文件重命名为001.png这种带0前缀的格式。

2024-05-27 10:24:18 281

原创 python字符串常见用法

原始字符串的规则是,让反斜杠后的字符保持不变,并且保留反斜杠。这就导致一个问题,当一个单独的反斜杠出现在字符串的最后一个位置时,解释器会认为标志着字符串结束的引号是字符串的一部分,而在它之后找不到字符串结束标志了,因此就会产生语法错误。因此,在使用原始字符串时,要注意最后一个字符不能是单独的一个反斜杠,或者说不能是奇数个反斜杠。当字符串最后一个字符一定要是反斜杠时,可以采取原始字符串+‘\\’的形式。

2023-12-01 09:37:39 552

原创 python文件读写

问题原因:文档默认使用’gbk’编码打开,但文档实际编码是gb18030,有些字符无法被gbk识别。python3支持多个参数,python2只有2个参数,且对于文件编码不支持。解决方案:打开文件的时候可以指定字符集为gb18030。普通模式(python2、python3通用)python2如何支持不同编码的文件读写?获取文件所在的文件目录。需要额外设置默认字符。

2023-12-01 09:33:23 400

原创 TCP状态机与定时器

本文中部分内容引用自以下文章列表:https://blog.csdn.net/wdscq1234/article/details/52505191https://blog.csdn.net/whgtheone/article/details/80970292https://blog.csdn.net/u013929635/article/details/82623611https://blog.csdn.net/xiaofei0859/article/details/52794576https://ww

2020-07-28 16:16:39 498

原创 互联网项目的部署、发布与测试

本文中部分内容引用自以下文章列表:https://www.jianshu.com/p/5862d7573bf2https://www.jianshu.com/p/f7b63a4d1488https://www.cnblogs.com/duanxz/p/5403980.html极客时间:朱赟的技术管理课*说明:本文是对已有概念的讲解,非原创,目的是为了将搜集到的资料更好的呈现给大家。概念:发布vs部署部署和发布的概念经常听到,但并不一定都能说得清楚,因此,先在开头澄清一下,方便大家理解:部

2020-07-26 23:30:12 2430

原创 从数学原理剖析链表中的环问题

找题目太麻烦了,为了偷懒,本文中部分前面7个题目引用自以下文章,不过描述方式并不是照抄,是根据自己的理解从数学原理层面进行了说明:https://www.cnblogs.com/yorkyang/p/10876604.html很多同学在面试时,都遇到过链表中的环问题,本文对于链表环的常见问题给出解答,并对原因进行透彻的分析。先列一下常见的问题:1.给一个单链表,判断其中是否有环的存在;2.如果存在环,找出环的入口点;3.如果存在环,求出环上节点的个数;4.如果存在环,求出链表的长度;5.如

2020-07-25 23:56:51 306

原创 MTU&MSS

本文中部分内容引用自以下文章列表:https://blog.csdn.net/passionkk/article/details/100538418https://blog.csdn.net/wcccg/article/details/79063974https://bbs.ikuai8.com/thread-64832-1-1.html1.概念介绍MTU:maximum transmission unit,最大传输单元,由硬件规定,如以太网的MTU为1500字节。MSS:maximum se

2020-07-25 01:00:33 1104

原创 P2550 [AHOI2001]彩票摇奖

https://www.luogu.com.cn/problem/P2550// 输出的中奖结果使用数组记录,位置1~7初始为0,每中一张彩票,对应位置+1// 使用一个数组记录中奖号码,每张彩票和此数组对比,对比结果初始为0,每比中一个数字,结果+1,7次的累计结果投入中奖结果数组#include <iostream>using namespace std;in...

2020-03-23 09:32:13 769

原创 P2615 神奇的幻方

https://www.luogu.com.cn/problem/P2615#include <iostream>using namespace std;int ouput[39*39] = {0};int main(){ int n(0); cin >> n; int total = n * n; int index = ...

2020-03-23 09:31:05 175

原创 P5730 【深基5.例10】显示屏

https://www.luogu.com.cn/problem/P5730// 首先将0~9的输出固化到预置数组// 根据输出数量,逐行输出,每行取每个数字的3个元素,共取5行#include <iostream>using namespace std;char num[10][15] = {'X','X','X','X','.','X','X','.','X','...

2020-03-23 09:29:44 1051

原创 P1308 统计单词数

https://www.luogu.com.cn/problem/P1308#include <cstdio>#include <cstring>#include <iostream>#include <string>#include <vector>using namespace std;static vect...

2020-03-23 09:24:37 121

原创 P1089 津津的储蓄计划

https://www.luogu.com.cn/problem/P1089// 逐月计算,需要记录当前余额、存储总额,如果当前余额+300<本月预算,则出现异常。// 年终:存储总额*1.2+当前余额#include <iostream>using namespace std;int main(){ int _remaining = 0; ...

2020-03-18 09:21:52 400

原创 P2181 对角线

https://www.luogu.com.cn/problem/P2181注意事项:高精,会超出int、long long的范围,需要使用 unsigned long long思路:n边形,先看每个点能够发出多少条对角线:n-3 (不能和自己、边上两个点连接)再看每条对角线有多少个交点,从第一条线开始,第一条线:左边1个点,右边n-2-1个点,交点数 1 * n-2-1第二条线:左边...

2020-03-17 21:17:52 461

原创 P5710 【深基3.例2】数的性质

https://www.luogu.com.cn/problem/P5710#include <iostream>using namespace std;int main(){ int n(0),a(0),b(0),c(0),d(0),b1(0),b2(0); cin >> n; if (n%2 == 0) b1 = 1...

2020-03-17 21:16:30 400

原创 P5717 【深基3.习8】三角形分类

https://www.luogu.com.cn/problem/P5717#include <iostream>using namespace std;int main(){ int a(0),b(0),c(0); cin >> a >> b >> c; if (a > c) { ...

2020-03-17 21:15:47 1023

原创 P4414 [COCI2006-2007#2] ABC

https://www.luogu.com.cn/problem/P4414#include <iostream>using namespace std;int main(){ int a(0),b(0),c(0); char a1,b1,c1; cin >> a >> b >> c; cin >&...

2020-03-17 21:14:30 657

原创 P1055 ISBN号码

https://www.luogu.com.cn/problem/P1055#include <iostream>using namespace std;int main(){ char _input[11] = {0}; cin >> _input[1] >> _input[0]; cin >> _input[...

2020-03-17 21:13:34 91

原创 P1008 三连击

https://www.luogu.com.cn/problem/P1008#include <iostream>using namespace std;int numList[10];void resetList(){ for(int i = 0; i < 10; i++) { numList[i] = 1; }}...

2020-02-05 11:05:48 121

原创 P1085 不高兴的津津

https://www.luogu.com.cn/problem/P1085#include <iostream>using namespace std;int main(){ int sum = 0; int n = 7; int iRet = -1; int a,b; for(int i = 0; i < n; i++...

2020-02-05 10:29:40 183

原创 P1781 宇宙总统

https://www.luogu.org/problem/P1781待处理内容:1.数据录入需要使用string2.排序(比较)需要根据string重写#include <iostream>#include <algorithm>#include <string>using namespace std;bool sortFun(co...

2019-11-17 17:15:47 129 1

原创 P1059 明明的随机数

https://www.luogu.org/problem/P1059两种方式:可以直接使用stl的map;也可以使用数组#include <iostream>#include <cstring>using namespace std;int inputList[1001];int main(){ int n; memset(i...

2019-11-17 16:43:03 66

原创 P1068 分数线划定

https://www.luogu.org/problem/P1068待处理内容:1.分数排序(从高到低),序号排序(从小到大)2.到分数线时,分数相等的继续输出#include <iostream>#include <vector>#include <algorithm>using namespace std;struct Item{...

2019-11-17 15:41:15 178

原创 P1098 字符串的展开

https://www.luogu.org/problem/P1098待处理内容:1.参数优先级:p3>p2>p12.-前后字符判断:相邻则删除符号;同为数字或者字母且后>前,则按参数处理;相等或其他情况则保持不变#include <iostream>#include <cstdio>#include <cstring>...

2019-11-09 22:53:58 97

原创 P1067 多项式输出

https://www.luogu.org/problem/P1067待处理内容:1.数字:为1不输出数字,为0不输出此项2.符号:第一个仅输出-,后续>=0输出+,<0输出-#include <iostream>using namespace std;int inputN[101];int num[101];char flag[101];i...

2019-11-09 21:55:01 74

原创 P1177 【模板】快速排序

https://www.luogu.org/problem/P1177#include <iostream>#include <fstream>using namespace std;int n;int inputList[100000];bool test = false;void swap(int i, int j){ if(tes...

2019-11-06 09:25:31 144

原创 P1031 均分纸牌

https://www.luogu.org/problem/P1031#include <iostream>using namespace std;int n;int inputList[100];int main(){ int sum = 0; cin >> n; for(int i = 0; i < n; i++)...

2019-11-05 09:17:36 70

原创 P1540 机器翻译

https://www.luogu.org/problem/P1540#include <iostream>#include <set>#include <string.h>using namespace std;int inputM[1001];int inputN[1001];set<int> mList;int m...

2019-11-04 09:32:32 103

原创 P1003 铺地毯

https://www.luogu.org/problem/P1003#include <iostream>#include <vector>using namespace std;struct SRectangle{ int a; int b; int x; int y;};int main(){ in...

2019-11-04 08:49:29 90

原创 P1911 L国的战斗之排兵布阵

https://www.luogu.org/problem/P1911#include <iostream>#include <set>#include <vector>#include <algorithm>using namespace std;struct SPoint{ int x; int y; ...

2019-11-03 14:21:25 420

原创 P1426 小鱼会有危险吗

https://www.luogu.org/problem/P1426#include <iostream>using namespace std;int main(void){ double s,x; cin>>s>>x; char cRet = 'n'; double sBegin = s-x; d...

2019-11-02 11:15:07 68

原创 运算符重载

struct Item{ int xi; int yi; //friend bool operator < (const Item & p1, const Item & p2) { // return p1.yi < p2.yi; //} //friend bool operator == (const It...

2019-11-01 21:34:32 92

原创 P1478 陶陶摘苹果(升级版)

https://www.luogu.org/problem/P1478#include <iostream>#include <vector>#include<algorithm>using namespace std;struct Item{ int xi; int yi;};vector<Item> ...

2019-11-01 21:17:30 105

原创 P1028 数的计算

https://www.luogu.org/problem/P1028#include <iostream>using namespace std;int dst[1001] = {0};int main(void){ int n; cin>>n; dst[0] = 1; dst[1] = 1; for(int ...

2019-11-01 20:48:29 91

原创 P1149 火柴棒等式

https://www.luogu.org/problem/P1149#include <iostream>#include <string>#include <string.h>#include <stdio.h>using namespace std;char array[10]={6,2,5,5,4,5,6,3,7,6};...

2019-11-01 20:15:23 195

原创 P1914 小书童——密码

https://www.luogu.org/problem/P1914//也可以设置一个a-za-z的数组,for循环里面就不用判断是否>25了#include <iostream>#include <string>using namespace std;int main(void){ int n; string str; c...

2019-11-01 19:09:05 93

原创 P1567 统计天数

https://www.luogu.org/problem/P1567#include <iostream>using namespace std;int array[1000000] = {0};int main(void){ int n; cin>>n; for(int i = 0; i < n; i++) {...

2019-11-01 18:55:22 130

原创 P1980 计数问题

https://www.luogu.org/problem/P1980#include <iostream>#include <string.h>#include <stdio.h>using namespace std;char str[8]={0};int countX(int n, int x){ memset(str, 0...

2019-11-01 18:43:54 67

原创 P1909 买铅笔

https://www.luogu.org/problem/P1909#include <iostream>using namespace std;int main(){ int n,num1,price1,num2,price2,num3,price3; cin>>n>>num1>>price1>>num...

2019-11-01 18:13:09 105

原创 P1422 小玉家的电费

https://www.luogu.org/problem/P1422#include<iostream>#include<cstdio>using namespace std;int main(void){ int a; cin>>a; if(a<=150) printf("%.1f\n", a*...

2019-11-01 18:02:40 125

原创 常用ACM输入处理

1、每行1组,无限2、每行1组,0 0结束3、每行1组,每组M个数字4、每行1组,每组M个数字,0结束5、N行,每行1组6、N行,每行1组,每组M个数字1、每行1组,无限C#include <stdio.h>main(){ int a, b; while(scanf("%d%d", &a, &b) != EOF) p...

2019-11-01 18:00:27 181

草稿-py处理文件-web页面展示

草稿-py处理文件-web页面展示

2023-07-05

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除