検索
Results of 1 - 2 of about 2 for rect (0.001 sec.)
- 構造体を使ったプログラム例 - Rust 日本語版 9357
- The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello,
...うようにプログラムをリファクタリングします。 Cargoで rectangles という新規バイナリプロジェクトを作成しましょ...長方形の面積は、{}平方ピクセルです "The area of the rectangle is {} square pixels.", area(width1, height1)...でこのプログラムを走らせてください: The area of the rectangle is 1500 square pixels. (長方形の面積は、1500平...しています。 ファイル名: src/main.rs fn main() { let rect1 = (30, 50); println!( "The area of the rectangle... - https://man.plustar.jp/rust/book/ch05-02-example-structs.html - [similar]
- メソッド記法 - Rust 日本語版 9357
- The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello,
...る構造体インスタンスを表します。 メソッドを定義する Rectangle インスタンスを引数に取る area 関数を変え、代わ...りに Rectangle 構造体上に area メソッドを作りましょう。 リス...ね。 ファイル名: src/main.rs #[derive(Debug)] struct Rectangle { width: u32, height: u32, } impl Rectangle {...u32 { self.width * self.height } } fn main() { let rect1 = Rectangle { width: 30, height: 50 }; println!(... - https://man.plustar.jp/rust/book/ch05-03-method-syntax.html - [similar]
PREV
1
NEXT