-
Rust연습_Fibonacci피보나치 출력코딩Coding/Rust연습 2021. 5. 13. 01:15728x90
fn main() { let mut i = 0; let mut a = 0; let mut c = 0; let mut b = 1; while i < 20 { if i > 1 { c = b; //1//1/2//3 b = b + a; //1+0=1/1+1=2////3 a = c; //1//1//2 println!(" {}", b); i = i + 1; } else { println!(" {}", i); i = i + 1; } } }
결과
www.youtube.com/watch?v=WgWrqLwMIgU
12345678910111213141516171819fn main() {let mut i = 0;let mut a = 0;let mut c = 0;let mut b = 1;while i < 20 {if i > 1 {c = b; //1//1/2//3b = b + a; //1+0=1/1+1=2////3a = c; //1//1//2println!(" {}", b);i = i + 1;} else {println!(" {}", i);i = i + 1;}}}cs 반응형'코딩Coding > Rust연습' 카테고리의 다른 글
Rust☆]Understanding ☆Ownership☆ in Rust&☆The Rules of References☆ (0) 2021.12.06 Rust연습]Control Flow_While문_3.2.1.LIFTOFF!!연습 (0) 2021.12.06 Rust연습]Common Programming Concepts in Rust (0) 2021.12.06 Rust연습) Guessing Game in Rust (0) 2021.12.04 Rust연습_피보나치 수열 출력하기 (0) 2021.05.13 Rust연습_Create a Calculator App러스트로 계산기 만들기-Engineer man (0) 2021.05.11 Rust연습 - 구조체 및 열거형을 사용하여 코드 수정(exercise-structs-enums) (0) 2021.05.11 Rust연습_추리 게임 튜토리얼 (0) 2021.05.09