- 博客(7)
- 收藏
- 关注
原创 字符串--删除
#include <stdio.h>#include <string.h>#include <malloc.h>char * d_e(char * str, char ch){ char * r ; char *q = (char *)malloc(strlen(str)+1); memset(q,0,strlen(str)+1); r ...
2018-09-08 10:23:44 181
原创 快速排序
#include <stdio.h>void swap(int *a, int *b){ int temp; temp = *a; *a = *b; *b = temp;}void q_sort(int a[], int n){ int l = 0; int r = n-1; if(n<=1) { return;...
2018-09-05 09:34:28 128
原创 c之scanf()
描述C库函数int scanf(const char * format,...)从stdin读取格式化输入。宣言以下是scanf()函数的声明。int scanf(const char *format, ...)参数 format - 这是包含以下一项或多项的C字符串 - 空白字符,非空白字符和格式说明符。格式说明符将类似于[=%[*] [width] [modifi...
2018-09-04 22:22:30 304
原创 定义求最小值宏
#include <stdio.h>#define MIN(A,B) ((A)<(B) ? (A):(B))main(){ printf("%d",MIN(3,6)); }
2018-09-04 07:19:00 1818
原创 检查数组片段反转后是否有序
#include <stdio.h>int pan_duan(int array[], int n){ int i ,j, k; int head_pos = 0; int rear_pos = 0; for(i = 0; i < n-1; i++ ) { if(array[i] > arra...
2018-09-03 07:43:19 198
原创 字符串反转
#include <stdio.h>#include <string.h>void str_verse(char a[]){ int i=0; int n=0; int j ; char temp; while(a[i]) { n++; i++; }i =0;n= 8;j = n/2;#if 1 whi...
2018-09-02 09:33:22 106
原创 冒泡排序
#include <stdio.h>void maopao(int * a[], int n){ int i,j;// int n ; int temp = 0;#if 1 for(i=0; i < n-1; i++ ) { for(j=0; j < n-i-1; j++) { if(a[j] > a[j+1]) { ...
2018-09-02 07:34:03 74
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人