建正建设集团有限公司网站,山东公司注册网上核名,html企业网站怎么做,wordpress加速cdn自己的碎碎念集合 2023-09-07 c++叠加三目运算符闰年计算法2023-08-13 一个小题目 A+B problem一、问题及解答关碍总结2023-07-26 C的2至36进制转换函数一、itoa()函数的示例代码总结2023-07-19 平面坐标下判断三角形以及输出周长和面积一. 基本知识总结2023-06-25 达芬奇去除白… 自己的碎碎念集合 2023-09-07 c++叠加三目运算符闰年计算法2023-08-13 一个小题目 A+B problem一、问题及解答关碍 总结 2023-07-26 C的2至36进制转换函数一、itoa()函数的示例代码总结 2023-07-19 平面坐标下判断三角形以及输出周长和面积一. 基本知识总结 2023-06-25 达芬奇去除白背景水印一、具体步骤总结 2023-06-20 将Libreoffice PPT 文档转换为txt文字2023-05-19 C语言非流输入一、windows平台二、linux平台总结 2023-05-11 字符与数组的运用小练习_C语言一、代码总结 2023-04-29 C语言二进制读写库一、代码总结 2023-04-25 二进制十进制相互转换一、二进制十进制等相互转换总结 2023-04-14 lua + C动态库交叉debug一、前期准备二、lldb注入进程总结 2023-04-13 Windows环境下lua输入输出编码转换一、为lua编写编码转换库二、lua调用编码转换库demo总结 2023-04-12 在Windows环境为lua编写模拟键盘库一、C语言为lua编写库代码总结 2023-04-04 在C++中使用 int128 类型一、int128 类型的简单使用总结 2023-03-28 scanf [A-B] 中[A-B]的意思2023-03-26 正则表达式的汉字支持一、解决方案: 宽字符总结 2023-02-07 C++ constexpr 需要全局或静态才能产生作用2023-02-03 UE 5.1 第一个游戏难点回顾一、UE5.1安装二、开始第一个游戏1. 学习视频地址  2023-02-02 C语言如何做到让函数知道传入的数据类型一、gnu扩展宏 __builtin_types_compatible_p二、使用步骤总结 2022-12-18 C++模板展开问题C++11的递归模板展开和C++17的逗号表达式展开总结 2022-11-20 C++小练习, 虚函数求平均值2022-11-19 C++ 基类, 派生类, 虚函数小练习题目:代码:  2023-09-07 c++叠加三目运算符闰年计算法 
原文连接: 
c++叠加三目运算符怎么看 
#includeiostream
#includecstdio
using namespace std;
int main()
{int x;cinx;cout(x%400==0?"YES":(x%4==0?(x%100!=0?"YES":"NO"):"No"));return 0;
}2023-08-13 一个小题目 A+B problem 
一个小算法问题, 记录一下 
一、问题及解答 
A+B problem( A+B problem ) 描述 小明有一个很大的数字,现在他想要在这个数字中间插入一个+号,来求出这个数的结果,并且他还想知道,这些数中哪个数末尾0最多。 输入 第一行一个整数T(t=100)表示数据组数 接下来有T行,每行一个数字字符(长度在10^5,最高位不为0) 输出 T行,每行一个整数,表示0最多有多少个 
输入 2 2017 44445555 
输出 0 3 
关碍 
条件是数字字符长度在10^5, 内置int类型不可能满足, 意味着可能用到高精度, 但本题不用. 
因为只是求末尾0, 意味着算法简单很多. 
如果最后一个字符数字是x, 只需在数字串中的其它部分找到的10-x, 如果x为0, 只需找到其它的0的个数即可. 
#include iostream
#include stringauto getLastChar(char num) - char
{char res = static_castchar('9' + '1' - num);return (res == '9' + 1) ? '0' : res;
}auto countZero(const std::string str) - int
{char chr = getLastChar(str.back());int cnt = 0;for (const auto i : str){if (i == chr){cnt++;}}return (chr == '5' || chr == '0') ? cnt - 1 : cnt;
}auto main() - int
{int T = 0;std::cin  T;std::vectorstd::string vecStr;vecStr.reserve(T);std::string str;for (int i = 0; i != T; ++i){std::cin  str;vecStr.push_back(str);}for (int i = 0; i != T; ++i){std::cout  countZero(vecStr[i])  '\n';}return 0;
} 总结 
算法不难, 但需要绕个小弯儿. 
2023-07-26 C的2至36进制转换函数 
有一些C语言初学者学语言的时候比较囫囵吞枣, 最简单的整数转2至36进制函数, 根本没听说过, 还有自己造轮子, 关键还写不对, 其实多看看书, 多查查资料, 有时候可以省很多时间. 一、itoa()函数的示例代码 
#include stdio.h
#include stdlib.h
#include windows.hchar digStr[64];int main()
{SetConsoleOutputCP(65001);int number = 123456;itoa(number, digStr, 2);printf("数字:%d 转换后的字符串为:%s\n", number, digStr);number = -123456;itoa(number, digStr, 2);printf("数字:%d 转换后的字符串为:%s\n", number, digStr);return 0;
}总结 
代码简单, 函数语义清晰, 简单记录一下. 
2023-07-19 平面坐标下判断三角形以及输出周长和面积 
平面坐标下判断三角形以及输出周长和面积, 用线性代数的简单知识. 一. 基本知识 
在平面坐标, 三个点就是三个向量, 可以通过两个向量同时减去第三个向量, 形成一个顶点在原点的三角形. 我们发现, 只有一种情况三角形不能成立, 就是从原点出发的两个向量在一条直线上  我们可以简单的用向量叉乘判断三角型是否成立, 同时, 向量叉乘的结果是向量形成的平行四边形面积  平行四边形面积的一半就是三角形面积 
而三角型的周长, 可以根据勾股定理得出三条边的长度, 相加得出. 
以下是代码: 
#include math.h
#include stdio.h// 定义向量结构体
typedef struct
{double x;double y;
} Vector;// 计算向量的差
Vector sub(Vector vecA, Vector vecB)
{return (Vector){vecA.x - vecB.x, vecA.y - vecB.y};
}// 计算向量的叉积
double cross(Vector vecA, Vector vecB)
{return vecA.x * vecB.y - vecA.y * vecB.x;
}// 计算两点之间的距离
double distance(Vector pointA, Vector pointB)
{Vector subAB = sub(pointA, pointB);return sqrt(subAB.x * subAB.x + subAB.y * subAB.y);
}// 计算三角形的周长
double triPer(Vector pointA, Vector pointB, Vector pointC)
{return distance(pointB, pointC) + distance(pointA, pointC) +distance(pointA, pointB);
}// 返回三角形面积, 向量叉积的二分之一的绝对值
double triArea(Vector vecA, Vector vecB, Vector vecC)
{return fabs(cross(sub(vecB, vecA), sub(vecC, vecA))) / 2.0;
}int main()
{Vector pointA;Vector pointB;Vector pointC;scanf("%lf %lf %lf %lf %lf %lf", pointA.x, pointA.y, pointB.x, pointB.y,pointC.x, pointC.y);double rest = triArea(pointA, pointB, pointC);// 判断平面三点是否可构成三角形, 即叉积不为零if (rest){printf("L = %.2lf, A = %.2lf", triPer(pointA, pointB, pointC), rest);}else{printf("Impossible");}return 0;
}总结 
近期在学OpenGL, 顺便学点图形学, 顺便也就学点线性代数, 这就是另外一个世界了. 
2023-06-25 达芬奇去除白背景水印 
录视频不小心整了个水印, 当时想了几个方法, 重录, ffmpeg命令搞一下, 一张一张幻灯片导成PNG然后一张一张换, 实在是太费劲了. 
于是想到这点小玩意达芬奇这么专业的软件一定有办法, 试了试, 还真行 一、具体步骤 
进入调色界面将所有片段选中, 鼠标右键, 添加到当前群组在节点区域, 选择片段前群组在下方的调整区, 选择窗口, 四边形, 调整大小和位置, 将水印覆盖调色区选一级校色条, 亮部的亮度拉满, 水印消失总结 
没有用到收费的功能, 但只能用于白底或黑底之上的水印, 不是智能去除. 
2023-06-20 将Libreoffice PPT 文档转换为txt文字 
有时候需要把ppt的文字内容抓出来, 想了一些办法, 没有成功, 后来发现直接用软件的内置功能即可: 
文件: 在浏览器中预览 
2023-05-19 C语言非流输入 
一个有意思的问题c语言的输入输出问题, 网上很多答案, 总结一下. 一、windows平台 
vs需要将getch()更改为_getch() 
#include conio.h
#include stdio.h
#include stdlib.hchar chrArr[32];int main()
{int i = 0;while ((chrArr[i] = getch())  (chrArr[i] != '\r')){++i;}char *num;int lhs = strtol(chrArr, num, 10);int rhs = atoi(num);printf("%d %d %d", lhs, rhs, lhs + rhs);
} 
二、linux平台 
#include stdio.h
#include stdlib.h
#include termio.h
#include stdbool.hint getch(void)
{return getchar();
}void setio(bool bl)
{static struct termios tm, tm_old;if (bl){tcgetattr(0, tm);tm_old = tm;cfmakeraw(tm); // 更改终端设置为原始模式,该模式下所有的输入数据以字节为单位被处理tcsetattr(0, TCSANOW, tm);}else{tcsetattr(0, TCSANOW, tm_old);}
}char chrArr[32];int main()
{setio(true);int i = 0;while ((chrArr[i] = getch())  (chrArr[i] != '\r')){++i;}setio(false);char *num;int lhs = strtol(chrArr, num, 10);int rhs = atoi(num);printf("%d %d %d\n", lhs, rhs, lhs + rhs);
} 总结 
vs要用 _getch(), mingw和clang用getch(), linux平台需要自己实现, 这不是标准库中的东西, 所以不可移植… 
2023-05-11 字符与数组的运用小练习_C语言 
一个问答题: 字符与数组的运用 , 考察知识点: scanf的使用, 字符串数组, 字符在C语言本质是整数, 循环, 分支. 一、代码 
一道小题目, 考的知识点包括了C语言输入输出, 字符类的本质, 循环, 分支, 挺好的. 
#include stdio.h
#include string.hchar strArr[100][100];void encrypted(char *chr);int main()
{int index = 0;// INT DOUBLE FOR WHILE// RETURNwhile (scanf("%s", strArr[index]) != EOF){for (int i = 0; i != strlen(strArr[index]); i++){encrypted(strArr[index] + i);}index++;}for (int i = 0; i != index; i++){printf("%s\n", strArr[i]);}return 0;
}void encrypted(char *chr)
{switch (*chr){case 'A':*chr = 'N';break;case 'B':*chr = 'O';break;case 'C':*chr = 'P';break;case 'D':*chr = 'Q';break;case 'E':*chr = 'R';break;case 'F':*chr = 'S';break;case 'G':*chr = 'T';break;case 'H':*chr = 'U';break;case 'I':*chr = 'V';break;case 'J':*chr = 'W';break;case 'K':*chr = 'X';break;case 'L':*chr = 'Y';break;case 'M':*chr = 'Z';break;case 'N':*chr = 'A';break;case 'O':*chr = 'B';break;case 'P':*chr = 'C';break;case 'Q':*chr = 'D';break;case 'R':*chr = 'E';break;case 'S':*chr = 'F';break;case 'T':*chr = 'G';break;case 'U':*chr = 'H';break;case 'V':*chr = 'I';break;case 'W':*chr = 'J';break;case 'X':*chr = 'K';break;case 'Y':*chr = 'L';break;case 'Z':*chr = 'M';break;}
} 总结 
出这道题的老师挺有水平. 2023-04-29 C语言二进制读写库 
压缩算法需要二进制读写库, 根据算法第四版重构C语言版. 可进行逐位读写, 主要用于数据压缩. 一、代码 
#ifndef BINSTDIO
#define BINSTDIO#include assert.h
#include stdbool.h
#include stdint.h
#include stdio.h
#include stdlib.h
#include string.h#ifdef _WIN64
#include fcntl.h
#include io.h
#endif// 读流到缓冲区
void binIO_fillBuffer();// 比特流是否为空
bool binIO_isEmpty();// 读取1位数据并返回一个bool值
bool binIO_readBool(bool *bit);// 读取8位数据并返回一个char值
bool binIO_readChar(unsigned char *chr);// 读取r(1~8)位数据并返回一个char值
bool binIO_readCharBit(unsigned char *chr, int bitSize);// 读取int16值
bool binIO_readShort(uint16_t *num);// 读取r(1~BUFSIZE_X_2)位数据并返回一个int16值
bool binIO_readShortBit(uint16_t *num, int bitSize);// 读取int值
bool binIO_readInt(uint32_t *num);// 读取r(1~32)位数据并返回一个int值
bool binIO_readIntBit(uint32_t *num, int bitSize);// 读取int64
bool binIO_readInt64(uint64_t *num);// 读取r(1~32)位数据并返回一个int值
bool binIO_readInt64Bit(uint64_t *num, int bitSize);// 关闭比特流
void binIO_close();// 恢复流状态
void binIO_clear();// 写入指定的比特
void binIO_writeBool(bool bit);// 写入指定的8位字符
void binIO_writeChar(unsigned char chr);// 写入指定字符的r(1~8)位
void binIO_writeCharBit(unsigned char chr, int bitSize);// 写入int16值
void binIO_writeShort(uint16_t num);// 写入 int16 值, bitSize 在范围 [1, BUFSIZE_X_2]
void binIO_writeShortBit(uint16_t num, int bitSize);// 写入int值
void binIO_writeInt(uint32_t num);// 写入指定 int 的 bitSize [1, 32] 位
void binIO_writeIntBit(uint32_t num, int bitSize);// 写入int64类型值
void binIO_writeInt64(uint64_t num);// 写入指定 int64 的 bitSize [1, 64] 位
void binIO_writeInt64Bit( 文章转载自: http://www.morning.lyjwb.cn.gov.cn.lyjwb.cn http://www.morning.chgmm.cn.gov.cn.chgmm.cn http://www.morning.qxxj.cn.gov.cn.qxxj.cn http://www.morning.flzqq.cn.gov.cn.flzqq.cn http://www.morning.llmhq.cn.gov.cn.llmhq.cn http://www.morning.rfmzc.cn.gov.cn.rfmzc.cn http://www.morning.yxbdl.cn.gov.cn.yxbdl.cn http://www.morning.dhyqg.cn.gov.cn.dhyqg.cn http://www.morning.drcnn.cn.gov.cn.drcnn.cn http://www.morning.lhxrn.cn.gov.cn.lhxrn.cn http://www.morning.zrbpx.cn.gov.cn.zrbpx.cn http://www.morning.swimstaracademy.cn.gov.cn.swimstaracademy.cn http://www.morning.tlzbt.cn.gov.cn.tlzbt.cn http://www.morning.wfysn.cn.gov.cn.wfysn.cn http://www.morning.nnykz.cn.gov.cn.nnykz.cn http://www.morning.knqck.cn.gov.cn.knqck.cn http://www.morning.mszwg.cn.gov.cn.mszwg.cn http://www.morning.gassnw.com.gov.cn.gassnw.com http://www.morning.wdxr.cn.gov.cn.wdxr.cn http://www.morning.cwtrl.cn.gov.cn.cwtrl.cn http://www.morning.zdmrf.cn.gov.cn.zdmrf.cn http://www.morning.wrkhf.cn.gov.cn.wrkhf.cn http://www.morning.dnqpq.cn.gov.cn.dnqpq.cn http://www.morning.zlchy.cn.gov.cn.zlchy.cn http://www.morning.rfhwc.cn.gov.cn.rfhwc.cn http://www.morning.rzbcz.cn.gov.cn.rzbcz.cn http://www.morning.bnlkc.cn.gov.cn.bnlkc.cn http://www.morning.sjftk.cn.gov.cn.sjftk.cn http://www.morning.lqjlg.cn.gov.cn.lqjlg.cn http://www.morning.zjcmr.cn.gov.cn.zjcmr.cn http://www.morning.bpkqd.cn.gov.cn.bpkqd.cn http://www.morning.hmmnb.cn.gov.cn.hmmnb.cn http://www.morning.msbmp.cn.gov.cn.msbmp.cn http://www.morning.btypn.cn.gov.cn.btypn.cn http://www.morning.lsjgh.cn.gov.cn.lsjgh.cn http://www.morning.xmbhc.cn.gov.cn.xmbhc.cn http://www.morning.yzdth.cn.gov.cn.yzdth.cn http://www.morning.qqfcf.cn.gov.cn.qqfcf.cn http://www.morning.wsxxq.cn.gov.cn.wsxxq.cn http://www.morning.rqrh.cn.gov.cn.rqrh.cn http://www.morning.yjdql.cn.gov.cn.yjdql.cn http://www.morning.ghyfm.cn.gov.cn.ghyfm.cn http://www.morning.cpwmj.cn.gov.cn.cpwmj.cn http://www.morning.mrxgm.cn.gov.cn.mrxgm.cn http://www.morning.dcmnl.cn.gov.cn.dcmnl.cn http://www.morning.qphdp.cn.gov.cn.qphdp.cn http://www.morning.ylqrc.cn.gov.cn.ylqrc.cn http://www.morning.fqnql.cn.gov.cn.fqnql.cn http://www.morning.lmqfq.cn.gov.cn.lmqfq.cn http://www.morning.jzbjx.cn.gov.cn.jzbjx.cn http://www.morning.fstdf.cn.gov.cn.fstdf.cn http://www.morning.blznh.cn.gov.cn.blznh.cn http://www.morning.mkczm.cn.gov.cn.mkczm.cn http://www.morning.qkdbz.cn.gov.cn.qkdbz.cn http://www.morning.sbncr.cn.gov.cn.sbncr.cn http://www.morning.qgkcs.cn.gov.cn.qgkcs.cn http://www.morning.xuejitest.com.gov.cn.xuejitest.com http://www.morning.lpmlx.cn.gov.cn.lpmlx.cn http://www.morning.addai.cn.gov.cn.addai.cn http://www.morning.fcwxs.cn.gov.cn.fcwxs.cn http://www.morning.pkpqh.cn.gov.cn.pkpqh.cn http://www.morning.dqcpm.cn.gov.cn.dqcpm.cn http://www.morning.fhyhr.cn.gov.cn.fhyhr.cn http://www.morning.yodajy.cn.gov.cn.yodajy.cn http://www.morning.pypqf.cn.gov.cn.pypqf.cn http://www.morning.bnmfq.cn.gov.cn.bnmfq.cn http://www.morning.zsgbt.cn.gov.cn.zsgbt.cn http://www.morning.pcshb.cn.gov.cn.pcshb.cn http://www.morning.dbnrl.cn.gov.cn.dbnrl.cn http://www.morning.xnqwk.cn.gov.cn.xnqwk.cn http://www.morning.fkflc.cn.gov.cn.fkflc.cn http://www.morning.qkrzn.cn.gov.cn.qkrzn.cn http://www.morning.lekbiao.com.gov.cn.lekbiao.com http://www.morning.qsmmq.cn.gov.cn.qsmmq.cn http://www.morning.tpnx.cn.gov.cn.tpnx.cn http://www.morning.zrdhd.cn.gov.cn.zrdhd.cn http://www.morning.ltksw.cn.gov.cn.ltksw.cn http://www.morning.hnk25076he.cn.gov.cn.hnk25076he.cn http://www.morning.ydfr.cn.gov.cn.ydfr.cn http://www.morning.zwznz.cn.gov.cn.zwznz.cn