编程
他们说快写一首情歌
这个作者很懒,什么都没留下…
展开
-
冒泡排序和插入排序
冒泡和插入排序 c 断言 表达式为真 则继续 表达式为假 则退出 就在当前位置、 使用规避手段处理未知语法 sizeof在编译阶段处理 int a =100; int x=sizeof(++a); int a=10; int x=4; 可见性见证编译链接 生存期见证运行过程 未成功编译不要谈生存期 char str[]={'y','h'}; 不默认/0 ...原创 2019-04-17 19:32:40 · 128 阅读 · 0 评论 -
二分查找
二分查找 特点 1.有序 2.必须是一个向量,连续空间(链表不算因为内存不连续) C语言自己造轮子 #include<iostream> using namespace std; //二分查找 //1.有序 2.必须是一个向量,连续空间(链表不算) int SearchValue(int* ar, int left, int right, int val); int FindVa...原创 2019-10-09 10:53:42 · 67 阅读 · 0 评论 -
C++ template用法
代码 #include<iostream> #include<vector> #include<list> using namespace std; //C++ 可重载和不可重载运算符 //.:成员访问运算符 //.*, ->*:成员指针访问运算符 //:::域运算符 //sizeof:长度运算符 //? : :条件运算符 //#: 预处理符号 voi...原创 2019-10-09 10:47:03 · 233 阅读 · 0 评论 -
Catoi
原创 2019-05-11 16:46:29 · 172 阅读 · 0 评论 -
c万年历
原创 2019-05-11 16:45:36 · 293 阅读 · 0 评论 -
c打单词
#include<windows.h> #include<conio.h> #include<stdio.h> #include<iostream> // #include<assert.h> #include<ctype.h> #include<limits.h> using namespace std;// ...原创 2019-05-11 16:44:39 · 238 阅读 · 0 评论 -
C字符串操作
C字符串操作 字符串求长度,连接,融合,比较 #include<stdio.h> int my_strlen(char* arr); char const *my_strcpy(char* arr1,char const *arr2); void my_strcat(char* arr1,char const *arr2); void my_strcmp(char const* a...原创 2019-03-30 21:12:34 · 313 阅读 · 1 评论 -
凯撒加密原理
#include<iostream> using namespace std; void Caesar(int const len, int * const Arr); void Generate(int *const Arr); const int Alen = 26; int main() { int len; int Arr[Alen]; Generate(Arr);...原创 2019-04-05 09:47:43 · 993 阅读 · 0 评论 -
简易计算机的实现
简易计算机的实现 #include<stdio.h> int Add_int(int a, int b); int Sub_int(int a, int b); int Mul_int(int a, int b); int Div_int(int a, int b); int main() { char flag; do { int a = 0; int b = 0...原创 2019-04-01 16:07:08 · 427 阅读 · 3 评论 -
数组位移操作
#include<iostream> using namespace std; void LeftMove(const int len, int *const Arr, const int length); void RightMove(const int len, int *const Arr, const int length); void Printf(const int...原创 2019-04-05 17:28:26 · 658 阅读 · 0 评论 -
C++判断闰年
#include<iostream> using namespace std; #define YEARERROR -1 #define MONTHERROR -2 #define DAYERROR -3 int day[13] = { 29,31,28,31,30,31,30,31,31,30,31,30,31 }; //数组多用于查表 int Judgmentinput(in...原创 2019-04-06 10:42:30 · 2272 阅读 · 0 评论 -
分治和递归策略
分治和递归策略 阶乘和斐波那契数列的实现 #include<iostream> using namespace std; //计算一个数字的阶乘 int m_fun(unsigned int num); int tea_fac(unsigned int n); //斐波那契数列 //1 1 2 3 5 8 13 //1 2 3 4 5 6 7 int m_ffun(int n);...原创 2019-10-09 10:55:29 · 104 阅读 · 0 评论