摘要: #include<stdio.h> #include<assert.h> #include<string.h> #define N 50 // int my_strcmp(char *dest, char *src) // { // assert((dest != NULL)&&(src != NU 阅读全文
posted @ 2021-10-05 23:42 major825 阅读(104) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<assert.h> #include<string.h> #define N 50 // char *my_strcat(char *dest, char *src) // { // assert((dest != NULL)&&(src != 阅读全文
posted @ 2021-10-05 22:53 major825 阅读(70) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 #include<assert.h> 3 #include<string.h> 4 5 #define N 20 6 char *my_strcpy(char *dest, char *src) 7 { 8 assert((dest != NULL)&&( 阅读全文
posted @ 2021-10-05 22:19 major825 阅读(92) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 #include<assert.h> 3 int my_strlen(const char *strDest) 4 { 5 6 assert(strDest != NULL);//断言:判断表达式一定为真,若为假,则终止程序 7 8 if(*strDest 阅读全文
posted @ 2021-10-05 20:07 major825 阅读(156) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 #include<assert.h> 3 unsigned int mystrlen(char *str) 4 { 5 unsigned int len = 0; 6 assert(str != NULL);//断言:判断表达式一定为真,若为假,则终止程序 阅读全文
posted @ 2021-10-05 19:39 major825 阅读(56) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 void sum(int num, int *x, int *y) 3 { 4 int flag = 0; 5 int i = 0; 6 *x = 0; 7 for(i = 0;i <= num; i = i+2)//变量的递增条件时i= i+2 8 { 阅读全文
posted @ 2021-10-05 17:39 major825 阅读(105) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 void swap(int *x, int *y) 3 { 4 int temp = 0; 5 temp = *x; 6 *x = *y; 7 *y = temp; 8 return; 9 } 10 11 int main(int argc, const 阅读全文
posted @ 2021-10-05 15:15 major825 阅读(75) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 int input_data(int *p,int len)//从键盘输入数据到数组 3 { 4 int i = 0; 5 for(i = 0; i < len; i++) 6 { 7 scanf("%d", &p[i]); 8 } 9 return 0; 阅读全文
posted @ 2021-10-05 15:02 major825 阅读(83) 评论(0) 推荐(0)
摘要: 1 #include<stdio.h> 2 int input_data(int *p,int len)//从键盘输入10个数据 3 { 4 int i = 0; 5 for(i = 0; i < len; i++) 6 { 7 scanf("%d", &p[i]); 8 } 9 return 0; 阅读全文
posted @ 2021-10-05 12:09 major825 阅读(105) 评论(0) 推荐(0)