Skip to content

Commit

Permalink
a283
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhengwei committed Dec 12, 2016
1 parent c948583 commit dfb6b29
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ leetcode 题解

[279. Perfect Squares](Solution/279.md)

[283. Move Zeroes](Solution/283.md)

[295. Find Median from Data Stream](Solution/295.md)

[342. Power of Four](Solution/342.md)
Expand Down
20 changes: 20 additions & 0 deletions Solution/283.md
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++;
}
}
}
```

0 comments on commit dfb6b29

Please sign in to comment.