- 博客(9)
- 收藏
- 关注
原创 排序算法
//插入排序 #include<iostream> using namespace std; #define maxn 10 void Insertion_Sort(int arr[], int n) { for (int i = 1; i < n; ++i) { int j = i - 1; int key = arr[...
2019-12-29 16:34:15 189
原创 宏参数
#include<iostream>#include<stdlib.h>#include<string>#include<windows.h>using namespace std;#define STR(s) (#s)#define STR1(a,b) (a##e##b)int main(void){ cout<<STR(...
2018-02-17 20:32:31 372
原创 atexit函数的使用
#include<iostream>#include<stdlib.h>#include<string>#include<windows.h>using namespace std;void fn1(void){ Sleep(1000); printf("fn1\n"); Sleep(1000);}void fn2(void){ Sleep(10...
2018-02-17 20:04:09 272
原创 数值交换的几种方式
#include<iostream>#include<stdlib.h>#include<string>#include<windows.h>using namespace std;void swap1(int &a, int &b){ int tmp=a; a = b; b = tmp;}void swap2(int *a,...
2018-02-17 19:45:25 581
原创 有符号变量与无符号变量的转换
#include<stdio.h>#include<stdlib.h>char getChar(int x,int y){ char c; unsigned int a = x; printf("%u\n",a+y); return ((a + y > 10) ? (c = 1) : (c = 2));}int main(void){ char c; c = getC...
2018-02-17 19:38:48 364
原创 关于全局运算符
#include<iostream>#include<stdlib.h>#include<string>#include<windows.h>using namespace std;int value=0;void printvalue(){ printf("::value=%d\n",value);}int main(void){ int...
2018-02-17 17:34:05 525 1
原创 C/C++面试常考基本位运算
#include<iostream>#include<stdlib.h>#include<string>#include<windows.h>using namespace std;int main(void){ int a=1; printf("%d\n",a); int x=3,y,z; x*=(y=z=4+2); printf("%d\...
2018-02-17 17:27:45 329 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人