上一页 1 ··· 314 315 316 317 318 319 320 321 322 ··· 407 下一页
摘要: 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 阅读(65) 评论(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 阅读(65) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> void rev_str(char x[][128], int n) { int i; for(i = 0; i < n; i++) { int j = 0; while(x[i][j]) j++; while(j-- > 0) putchar(x[i][ 阅读全文
posted @ 2021-05-26 22:07 小鲨鱼2018 阅读(50) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> #define NUMBER 5 #define STR 128 void put(char x[][STR], int n) { int i; for(i = 0; i < n; i++) { if(strcmp(x[i], "$$$$$") == 0) 阅读全文
posted @ 2021-05-26 21:29 小鲨鱼2018 阅读(40) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> void del_dit(char x[]) { int i = 0, j = 0; char tmp[129]; while(x[i]) { if((x[i] - '0') < 0 || (x[i] - '0') > 9) { tmp[j] = x[i] 阅读全文
posted @ 2021-05-26 17:48 小鲨鱼2018 阅读(71) 评论(0) 推荐(0)
摘要: c语言中实现字符串大小写的转换。 1、 #include <stdio.h> #include <ctype.h> void str_toupper(char x[]) { int i = 0; while(x[i]) { x[i] = toupper(x[i]); i++; } } void st 阅读全文
posted @ 2021-05-26 16:52 小鲨鱼2018 阅读(2465) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> void rev_put(char x[]) { int i, len = 0; while(x[len]) len++; for(i = 0; i < len / 2; i++) { char tmp = x[i]; x[i] = x[len - 1 - 阅读全文
posted @ 2021-05-26 16:34 小鲨鱼2018 阅读(48) 评论(0) 推荐(0)
摘要: c语言中统计字符串中数字字符出现的次数。 1、 #include <stdio.h> void int_count(char x[], int cnt[]) { int i; while(x[i]) { if(x[i] >= '0' && x[i] <= '9') { cnt[x[i] - '0'] 阅读全文
posted @ 2021-05-26 16:06 小鲨鱼2018 阅读(1957) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> void put(char x[]) { int len = 0; while(x[len]) len++; int i = 0; while(x[i]) { putchar(x[len - 1 - i++]); } putchar('\n'); } in 阅读全文
posted @ 2021-05-26 13:13 小鲨鱼2018 阅读(73) 评论(0) 推荐(0)
摘要: 1、 #include <stdio.h> void put(char x[], int n) { while(n-- > 0) printf(x); putchar('\n'); } int main(void) { char str[128]; int n; printf("str: "); s 阅读全文
posted @ 2021-05-26 12:34 小鲨鱼2018 阅读(63) 评论(0) 推荐(0)
上一页 1 ··· 314 315 316 317 318 319 320 321 322 ··· 407 下一页