-
Rust연습]Easy Rust 024: Control flow 1(match+if)코딩Coding/Rust연습 2021. 12. 12. 20:56728x90
// CONTROL FLOW fn main() { let children = 5; let married = true; match (children, married) { (children, married) if married == false => { println!("Not married with {} children", children) } (children, married) if children == 0 && married == true => { println!("Married but no children") } _ => println!("Married? {}. Number of children: {}", married, children), } }
출처 :
https://www.youtube.com/watch?v=UAymDOpv_us&list=PLfllocyHVgsRwLkTAhG0E-2QxCf-ozBkk&index=25
반응형'코딩Coding > Rust연습' 카테고리의 다른 글
rust 연습] iter(), zip() 연습 (0) 2022.04.11 Rust연습] 16진수출력❤️HexRGB(Color) 연습출처 : Rust 101 - Lecture 1 (0) 2022.04.04 Rust연습]자연수 유니코드ℕ Unicode번호(16진수)알아보기 (0) 2022.03.23 Rust연습-curves_rs::canvas,pixel by (0) 2022.02.03 [Rust연습]Easy Rust 024: Control flow 1(if, else if, else) (0) 2021.12.12 RUST연습]Easy Rust 022: Vecs (0) 2021.12.12 RUST연습]변수 사이즈크기 알아보기(use std::mem::size_of;) (0) 2021.12.10 Rust연습]Shadowing (0) 2021.12.09