游戏外星人:编程求一个字符串的长度, 用字符数组实现
来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 13:11:17
main()
{ char max, *s="I am a student";
int n;
max=*s;
while (*s!='\0')
{ if (*s > max) max=*s;
【 】;
}
printf("\nThe max character is: %c", max);
}
程序运行结果:
The max character is: 【 】
{ char max, *s="I am a student";
int n;
max=*s;
while (*s!='\0')
{ if (*s > max) max=*s;
【 】;
}
printf("\nThe max character is: %c", max);
}
程序运行结果:
The max character is: 【 】
楼主,这个程序是找字符串中最大的字符啊。
s++
u