-
Rust연습_if절_else if _ else코딩Coding/Rust연습 2020. 9. 5. 23:52728x90
fn main() { let n = 20; if n < 30 { println!("The number is less than 30!"); } }
결과
fn main() { let n = 45; if n < 30 { println!("The number is less than 30!"); } }
결과
fn main() { let n = 45; if n == 45 { println!("Rust"); } }
결과
fn main() { let n = 56; if n == 45 { println!("Rust"); } else { println!("It was not 45!"); } }
결과
fn main() { let n = 56; if n == 45 { println!("Rust"); } else if n > 50 { println!("It is greater than 50!"); } else { println!("It was not 45 and it was less than 50"); } }
결과
fn main() { let n = 20; if n == 45 { println!("Rust"); } else if n > 50 { println!("It is greater than 50!"); } else { println!("It was not 45 and it was less than 50"); } }
결과
fn main() { let n = 20; if (n == 45) { println!("Rust"); } else if n > 50 { println!("It is greater than 50!"); } else { println!("It was not 45 and it was less than 50"); } }
결과
▷ 다른글 보기 ◁
★★★Rust Toturial 로드맵(Road Map)첫시작!-★★★(총정리)Rustacean이 되어 보자!!Let's go! (tistory.com)
반응형'코딩Coding > Rust연습' 카테고리의 다른 글
Rust연습-Mutability_ In Rust, variable bindings are immutable by default. (0) 2021.05.08 Rust연습_데이터 형식 알아보기(u32, i32..) (0) 2021.05.08 Rust연습_변수 만들고 출력(Create and use variables) (0) 2021.05.08 Rust연습_탐색기창에서VSCode불러오고TestRust프로젝트만들기(첫문서) (0) 2021.05.08 rust연습_속도란 바로 rust가 짱 ㅋㅋ (0) 2020.09.10 Rust_티스토리_코딩자료_올리기-Highlight.js (0) 2020.09.10 Rust연습_ X출력하기 (0) 2020.09.05 Rust연습_주석처리하기 Comment (0) 2020.09.05