This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0xB9C9Ef26d3a7Ea1cd2c989092088ddAdF85cfd66 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
struct Division { | |
numerateur: i32, | |
denominateur: i32, | |
} | |
impl Division { | |
fn new(x: i32, y: i32) -> Division { | |
Division { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
#[derive(Copy, Clone)] | |
struct Division { | |
numerateur: i32, | |
denominateur: i32, | |
} | |
impl Division { | |
fn new(x: i32, y: i32) -> Division { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
struct Division { | |
numerateur: i32, | |
denominateur: i32, | |
} | |
impl Division { | |
fn new(x: i32, y: i32) -> Division { | |
Division { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
struct Division { | |
numerateur: i32, | |
denominateur: i32, | |
} | |
impl Division { | |
fn new(x: i32, y: i32) -> Division { | |
Division { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
struct Division { | |
numerateur: i32, | |
denominateur: i32, | |
} | |
impl Division { | |
fn new(x: i32, y: i32) -> Division { | |
Division { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
struct Division { | |
numerateur: i32, | |
denominateur: i32, | |
} | |
impl Division { | |
fn calculer(&self) -> i32 { | |
match self.denominateur { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
fn calculer_division(x: i32, y: i32) -> i32 { | |
match y { | |
0 => panic!("Division par 0"), | |
1 => x, | |
_ => x / y | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::env; | |
fn calculer_division(x: i32, y: i32) -> i32 { | |
match y { | |
0 => panic!("Division par 0"), | |
1 => x, | |
_ => x / y | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn calculer_division(x: i32, y: i32) -> i32 { | |
match y { | |
0 => panic!("Division par 0"), | |
1 => x, | |
_ => x / y | |
} | |
} | |
fn main() { | |
let resultat = calculer_division(-4, 2); |
NewerOlder