- 博客(3)
- 收藏
- 关注
原创 C语言,计算字符串长度,不用strcat
#include <stdio.h>main(){ char a[100]; int i=0; gets(a); while(a[i]!='\0') i++; printf("%d",i);}
2018-05-27 23:06:10 952
原创 C语言,连接2个字符串,不用strcat
#include <stdio.h>main(){ char a[100],b[100]; int i=0,j=0; printf("Please input 2 strings:\n"); gets(a); //输入字符串啊,a,b gets(b); while(a[i]!='\0') i++; // i 表示字符串a的'\0'所在的位置 ...
2018-05-27 22:59:56 27947 2
原创 C语言,将字符串str内容倒置输出
#include <stdio.h>#include <string.h>int main(){ char str[]="abcdefg"; int i,j,k; j=strlen(str)-1; for(i=0;i<j;i++,j--) { k=str[i]; str[i]=str[j]; str[j...
2018-05-27 22:20:58 14907
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人