mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-10 20:40:39 +08:00
添加 0344.反转字符串.md C语言版本
This commit is contained in:
@ -218,7 +218,19 @@ func reverseString(_ s: inout [Character]) {
|
||||
}
|
||||
```
|
||||
|
||||
C:
|
||||
```c
|
||||
void reverseString(char* s, int sSize){
|
||||
int left = 0;
|
||||
int right = sSize - 1;
|
||||
|
||||
while(left < right) {
|
||||
char temp = s[left];
|
||||
s[left++] = s[right];
|
||||
s[right--] = temp;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
-----------------------
|
||||
|
Reference in New Issue
Block a user