自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(11)
  • 资源 (1)
  • 收藏
  • 关注

原创 reverse

反转字符串的程序,比如”abcdefghi” -> “ihgfedcba”#include <stdio.h>#include <string.h>char *reverse(char *set){ int i,j; char temp; if(set == NULL) return NULL; for(i = 0,j = strlen(set) - 1; i < j; i++,j--) { temp = set[i]; set.

2021-10-08 22:04:40 60

原创 mystrstr

#include <stdio.h>#include <string.h>//strstr(str1,str2) 函数用于判断字符串str2是否是str1的子串。//如果是,则该函数返回str2在str1中首次出现的地址;否则,返回NULL。char *mystrstr(const char *set,const char *res){ int i,j,x; char *temp = set; if(set == NULL || res == NULL) .

2021-10-08 22:01:21 154

原创 mystrlen

#include <stdio.h>int mystrlen(const char *str){ int i; if(str == NULL) return -1; for(i = 0; str[i] != '\0'; i++); return i-1;}int main(void){ int res; char str[] = "hello world!"; res = mystrlen(str); printf("------res = %d---.

2021-09-29 19:25:18 187

原创 mystrcat

#include <stdio.h>#include <string.h>int mystrcpy(char *str,const char *res){ int i; if(str == NULL || res == NULL) { return -1; } for(i = 0; res[i] != '\0'; i++) str[i] = res[i]; str[i] = res[i]; return 0;}int main(void).

2021-09-29 19:23:21 72

原创 mystrcmp

#include <stdio.h>int mystrcmp(const char * set,const char * res);int main(void){ int x; char set[] = "he"; char res[] = "hello"; x = mystrcmp(set,res); printf("x = %d\n",x); return 0;}int mystrcmp(const char * set,const char * res).

2021-09-28 21:28:07 156

原创 mystrcpy

#include <stdio.h>#include <string.h>int mystrcpy(char *str,const char *res){ int i; if(str == NULL || res == NULL) { return -1; } for(i = 0; res[i] != '\0'; i++) str[i] = res[i]; str[i] = res[i]; return 0;}int main(void).

2021-09-27 22:24:25 170

原创 C快速排序

#include <stdio.h>//快速排序void Quick_Sort(int arr[],int head,int tail){ if(head > tail) return ; int i,j,temp,res; i = head; j = tail; temp = arr[head]; while(i != j) { while(arr[j] >= t...

2021-09-26 23:06:59 47

原创 字符串库函数

#include <string.h>1、char *strcpy(char *dest,const char *src):从src指针指向的内存中拷贝\0及以前的数据到dest指针指向的内存中,返回值为第一参数记录的地址2、char *strncpy(char *dest,const char *src,size_t n):从src指针指向的内存中拷贝n个字节的数据到dest指针指向的内存中,返回值为第一参数记录的地址3、size_t strlen(const char *s)

2021-09-26 21:10:27 52

原创 C选择排序

#include <stdio.h>//选择排序:把大值和小值往两边摞动int main(void){ int x, i, j, temp, min, max, right, left = 0; int arr[] = {5,61,4,20,25}; printf("请选择升序or降序排序(1表示升序,2表示降序):"); scanf("%d",&x); right = sizeof(arr) / sizeof(int) - 1;...

2021-09-26 21:02:02 42

原创 C冒泡排序

今日分享–冒泡排序

2021-09-25 17:29:08 40

原创 关于sscanf字符串的分割

intmain(){char*buf="zhangsan man 21";chara[9],b[4];intc;sscanf(buf,"%s%s%d",a,b,&c);printf("%s\n%s\n%d\n",a,b,c);return0;}如:char *buf = "zhangsan-man-21";则:sscanf(buf,"%s-%s...

2021-09-23 21:45:33 536

五子棋(C)棋盘 判断 棋手切换

五子棋(C)棋盘 判断 棋手切换

2021-09-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除