2022-12-23から1日間の記事一覧
#[derive(Debug, Clone, PartialEq)] struct Circle { x: f64, y: f64, radius: f64, } impl Circle { pub fn area(self) -> f64 { // std::f64::consts::PI * (self.radius * self.radius) std::f64::consts::PI * (3.1 * 3.1) } } fn main() { let a = Cir…