上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 22 下一页
摘要: 1 void strmcpy(char *t, int m, char *s) 2 { 3 int len = 0; //计算字符串t的长度 4 char *p = t; 5 int i; 6 while (*p != '\0') 7 { 8 len++; 9 p++; 10 } 11 12 if 阅读全文
posted @ 2019-12-20 11:59 jason2018 阅读(2710) 评论(0) 推荐(0) 编辑
摘要: 1 void CountOff(int n, int m, int out[]) 2 { 3 4 int person[n + 1]; 5 int i; 6 int count; 7 8 /* 9 给编号1到n的人打上标签 10 =0在圈子中 11 =1退出圈子 12 */ 13 for (i = 阅读全文
posted @ 2019-12-20 10:47 jason2018 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 1 int ArrayShift(int a[], int n, int m) 2 { 3 int at[MAXN]; 4 5 m = m % n; 6 for (int i = 0; i < m; i++) 7 { 8 at[i] = a[n - m + i]; 9 } 10 for (int i 阅读全文
posted @ 2019-12-19 14:07 jason2018 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 1 void Shift(char s[]) 2 { 3 char st1[MAXS]; 4 char st2[MAXS]; 5 strcpy(st1, s); 6 st1[3] = '\0'; //st1字符串中只有s字符串的前3个字符 7 strcpy(st2, s + 3); //st2字符串 阅读全文
posted @ 2019-12-19 10:51 jason2018 阅读(1070) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main(void) 5 { 6 int number; 7 int *a; 8 int i; 9 printf("请输入数量:"); 10 scanf("%d", &number); 11 //i 阅读全文
posted @ 2019-12-18 11:22 jason2018 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 3 int main(void) 4 { 5 char a[] = "hello"; //字符串以字符串数组的形式保存,末尾加上'\n' 6 printf("%d\n", sizeof(a)); 7 8 for (int i = 0; i < sizeo 阅读全文
posted @ 2019-12-17 16:06 jason2018 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 void minmax(int *a, int len, int *min, int *max); 3 int main(void) 4 { 5 int a[] = { 6 1, 7 2, 8 3, 9 4, 10 5, 11 6, 12 7, 13 8 阅读全文
posted @ 2019-12-17 14:48 jason2018 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 3 int main(void) 4 { 5 6 int a[10]; 7 8 printf("%p\n",&a); 9 printf("%p\n",a); 10 printf("%p\n",&a[0]); 11 printf("%p\n",&a[1]) 阅读全文
posted @ 2019-12-17 09:21 jason2018 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 每次启动powershell后输入:chcp 65001 阅读全文
posted @ 2019-12-16 09:14 jason2018 阅读(3592) 评论(0) 推荐(0) 编辑
摘要: 利用指针返回多个函数值 1 #include <stdio.h> 2 void month_day(int year, int yearday, int *pmonth, int *pday); 3 4 int main(void) 5 { 6 int day, month, year, yeard 阅读全文
posted @ 2019-12-15 16:44 jason2018 阅读(155) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 22 下一页