本帖最后由 shenxian88 于 2015-5-13 13:59 编辑
void main()
{
char s[80], *t, max, *w;
t=s;
gets(t);
max=*(t++);
while (*t!='\0')
{
if (max<*t)
{ max=*t; w=t; }
t++;
}
t=w;
while (【1】)
{
*t=*(t-1);
【2】;}
*t=max;
puts(t);
}
要求输入一个字符串,然后把字符串中最大的一个字符放到字符串前面,例如输入“line”,执行后输出“nlie”
求解答空【1】、【2】;怎样填;并分析这样填的 原因 |
|