请问为何函数传值失败呢?

#include <stdio.h>
#include <stdlib.h>
#include <string.h> 

char change(char s[]){
    int n=0,m=0,i;
    int x;
    x=strlen(s); 
    for(i=0;i<=x;i++){
        if(s[i]=='a') n++;
        else s[m++]=s[i];
    }
    while(n--) s[m++]='a';
    return s;
}
int main(int argc, char *argv[]) {
    char s[900],s1;
    scanf("%s",&s);
    s1=change(s);
    printf("%s",s1);
    return 0;
}
全部评论

相关推荐

今天 16:33
已编辑
微软_sde(实习员工)
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务