作者在 2009-02-17 14:46:38 发布以下内容
将输入的字符串的最后一位变成x,如
input
abcd
output
abcx
---------------
#include <stdio.h>
int main(void)
{
char a[10], *p;
p = a;
scanf("%s",p);
for ( ; *p !='\0' ; p++)
;
p--;
*p = 'X';
printf("%s",a);
getch();
return 0;
}