Skip to content

ring.rs 是否应该添加一个终止条件会更好 #13

@peanut-cc

Description

@peanut-cc

当NUM - out 的值小于 COUNT的时候应该退出循环,这样最终如果加上打印ring的值可以更加直观的看到结果

if j == COUNT {
    println!("{} ----> out", i+1);
    out = out + 1;
    ring[i] = 0;
    j = 0;
    if NUM-out < COUNT {
        break;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions