use std::cell::Cell;

fn main() {
    let c = Cell::new(100);
    let v = c.replace(200);
    println!("書き換え前：{v}, 書き換え後：{}", c.get());

    let mut c = Cell::new(100);
    let r = c.get_mut();
    let v = *r;
    *r = 200;
    println!("書き換え前：{v}, 書き換え後：{}", c.get());
}
