摘要: 1、 #include <stdio.h> void rev(char x[][128], int n) { int i; for(i = 0; i < n; i++) { int len = 0; while(x[i][len]) len++; int j = 0; while(x[i][j]) 阅读全文
posted @ 2021-05-27 19:12 小鲨鱼2018 阅读(55) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #define NUMBER 5 #define STR 128 void show(char x[][STR], int n) { int i; for(i = 0; i < n; i++) { if(strcmp(x[i], "$$$$$") == 0 阅读全文
posted @ 2021-05-27 18:45 小鲨鱼2018 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> void del(char x[]) { int len = 0; while(x[len]) len++; char tmp[len]; int i = 0, j = 0; while(x[i]) { if(x[i] < '0' || x[i] > '9 阅读全文
posted @ 2021-05-27 17:28 小鲨鱼2018 阅读(65) 评论(0) 推荐(0) 编辑
摘要: c语言中大小写字符转换。 1、 #include <stdio.h> #include <ctype.h> void upper(char x[]) { int i = 0; while(x[i]) { x[i] = toupper(x[i]); i++; } } void lower(char x 阅读全文
posted @ 2021-05-27 17:02 小鲨鱼2018 阅读(1836) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> void put(char x[]) { int len = 0; while(x[len]) len++; int i; for(i = 0; i < len / 2; i++) { int tmp = x[i]; x[i] = x[len - 1 - 阅读全文
posted @ 2021-05-27 16:52 小鲨鱼2018 阅读(48) 评论(0) 推荐(0) 编辑
摘要: c语言中统计字符串中数字出现的次数。 1、 #include <stdio.h> void count(char x[], int y[]) { int i = 0; while(x[i]) { if(x[i] >= '0' && x[i] <= '9') y[x[i] - '0']++; i++; 阅读全文
posted @ 2021-05-27 16:22 小鲨鱼2018 阅读(1270) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> void put(char x[]) { int len = 0; while(x[len]) len++; while(len-- > 0) { putchar(x[len]); } } int main(void) { char str[128]; p 阅读全文
posted @ 2021-05-27 13:03 小鲨鱼2018 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> void put(char x[], int n) { int i; for(i = 0; i < n; i++) { printf("%s", x); } } int main(void) { char str[128]; printf("str: ") 阅读全文
posted @ 2021-05-27 12:51 小鲨鱼2018 阅读(62) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int str_chnum(char x[], int key) { int len = 0; while(x[len]) len++; int j = 0; while(len-- > 0) { if(x[len] == key) j++; } if(j 阅读全文
posted @ 2021-05-27 12:11 小鲨鱼2018 阅读(53) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int str_char(char x[], int key) { int len = 0; while(x[len]) len++; int i; for(i = 0; i < len; i++) { if(x[i] == key) return i; 阅读全文
posted @ 2021-05-27 11:25 小鲨鱼2018 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> void null_str(char x[]) { x[0] = '\0'; } int main(void) { char str[128]; printf("str: "); scanf("%s", str); null_str(str); puts( 阅读全文
posted @ 2021-05-27 11:09 小鲨鱼2018 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #define NUMBER 5 int main(void) { char str[NUMBER][128]; int i; for(i = 0; i < NUMBER; i++) { printf("str[%d] = ", i); scanf("%s 阅读全文
posted @ 2021-05-27 10:14 小鲨鱼2018 阅读(50) 评论(0) 推荐(0) 编辑