llllmz

导航

344. 反转字符串C

void reverseString(char* s, int sSize) {
    int head=0,tail=sSize-1;
    while(head<=tail){
        char t=s[head];
        s[head]=s[tail];
        s[tail]=t;
        head++;
        tail--;
    }
}

1min36

结果:

posted on 2024-02-28 22:33  神奇的萝卜丝  阅读(8)  评论(0)    收藏  举报