-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
chenzhengwei
committed
Dec 12, 2016
1 parent
c948583
commit dfb6b29
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#283. Move Zeroes | ||
[题目链接](https://leetcode.com/problems/move-zeroes/) | ||
```c | ||
void moveZeroes(int* nums, int numsSize) { | ||
int pos = 0; | ||
int i; | ||
int temp; | ||
for(i=0; i<numsSize; i++) | ||
{ | ||
// 不为0的时候 | ||
if(nums[i]) | ||
{ | ||
temp = nums[pos]; | ||
nums[pos] = nums[i]; | ||
nums[i] = temp; | ||
pos++; | ||
} | ||
} | ||
} | ||
``` |