- 博客(8)
- 收藏
- 关注
转载 基础练习 芯片测试
#include #include #include #include using namespace std; int main() { int n; cin>>n; int a[25][25]; for(int i=0;i { for(int j=0;j { cin>>a[i][j]; } } for(int i=0;i { int cnt=
2017-03-03 20:10:31 268
原创 【基】FJ 的字符串 递归
j=a[i]-48; s[i] - ‘0’ 基础练习 FJ的字符串 #include #include #include #include using namespace std; void An(int n) //递归!!!!!! { if(n==1) cout for(int i=2;i { if(i An(i-1); pri
2017-02-27 23:23:35 182
转载 各种排序算法的实现
//各种排序算法的实现 /* 交换函数 */ void swap(int *list, int low, int high ) { int temp = list[low]; list[low] = list[high]; list[high] = temp; } /* 小于函数 */
2017-01-20 21:09:34 152
转载 快速排序
快速排序 void print(int a[], int n){ for(intj= 0; j cout } cout } void swap(int *a, int *b) { inttmp = *a; *a= *b; *b= tmp; }
2017-01-20 16:31:48 143
转载 二维数组排序
二维数组排序 #include #include #include using namespace std; struct Data { chardata[100]; }str[100]; bool cmp(const Data &elem1, const Data&elem2) { if(strcmp(elem1.d
2017-01-20 16:30:26 129
转载 关于字符串操作
1)字符串操作 strcpy(p, p1) 复制字符串 strncpy(p, p1, n) 复制指定长度字符串 strcat(p, p1) 附加字符串 strncat(p, p1, n) 附加指定长度字符串 strlen(p) 取字符串长度 strcmp(p, p1) 比较字符串 strcasecmp忽略大小写比较字符串 strncmp(p, p1, n) 比较指定长
2017-01-20 16:28:02 300
原创 strcpy、strncpy与memcpy strlen strcat strcmp
一、函数说明 1、memcpy函数 void *memcpy(void *s1, const void *s2, size_t n); 说明: 函数memcpy从s2指向的对象中复制n个字符到s1指向的对象中。如果复制发生在两个重叠的对象中,则这种行为未定义。 返回值: 函数memcpy返回s1的值。 2、strcpy函数 char *strcpy(char *s2,
2017-01-20 15:47:11 261
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人