#include<stdio.h>
#include<string.h>
void sckg(char *a)
{
int i;
for(i=strlen(a)-1;a[i]==' ';i--);
a[i+1]='\0';
}
int main()
{
char a[100]; //修改處1:指針a必須有具體的地址
printf("please enter the string:\n");
//scanf("%s",a); //修改處2:%接收字符串時,遇到空格、跳格、回車止
gets(a); //修改處3:可以接收包含空格、跳格、回車在內的各種字符
sckg(a);
printf("%s",a);
return 0;
}