Skip to content

Latest commit

 

History

History
20 lines (20 loc) · 392 Bytes

283.md

File metadata and controls

20 lines (20 loc) · 392 Bytes

#283. Move Zeroes 题目链接

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++;
        }
    }
}