Lộ trình học

Nền tảng Rust

Từ chương trình đầu tiên đến biến, kiểu dữ liệu, điều kiện, vòng lặp, chuỗi, vector và hàm, kèm một bài tập sau mỗi chủ đề.

17 bài học · 31 thử thách

1 Bắt đầu 5 bài học

  1. Bài học 2 thử thách Hello World and Program Structure Write your first Rust program and learn what fn main and println! do.
  2. Bài học 2 thử thách Variables and Mutability Declare variables with let, allow changes with mut, and use constants and shadowing.
  3. Bài học 2 thử thách Data Types Work with integers, floating-point numbers, booleans and characters, and convert between them.
  4. Bài học 2 thử thách Operators and Arithmetic Use arithmetic, comparison and logical operators, and see how integer division works.
  5. Bài học 2 thử thách Reading User Input Read a line from the keyboard and turn it into a number safely.

2 Rẽ nhánh 2 bài học

  1. Bài học 2 thử thách Conditions with if and else Choose what runs with if, else if and else, and use if as an expression.
  2. Bài học 1 thử thách FizzBuzz Solve the classic FizzBuzz problem with match on a tuple.

3 Vòng lặp 2 bài học

  1. Bài học 2 thử thách Loops: for, while and loop Repeat code with for over a range, while with a condition, and loop with break.
  2. Bài học 2 thử thách Prime Numbers Check whether a number is prime and list the primes up to 30.

4 Chuỗi và văn bản 2 bài học

  1. Bài học 2 thử thách Strings: String and &str Create, grow, search and split text with Rust's two string types.
  2. Bài học 1 thử thách Reverse a String Reverse the characters of a string and the words of a sentence.

5 Tập hợp dữ liệu 3 bài học

  1. Bài học 2 thử thách Tuples and Arrays Group values with tuples and store a fixed number of items in an array.
  2. Bài học 2 thử thách Vectors Store a growing list of values in a Vec and read items safely.
  3. Bài học 2 thử thách Fibonacci Sequence Generate Fibonacci numbers with a loop and a vector.

6 Hàm 2 bài học

  1. Bài học 2 thử thách Functions and Return Values Define functions with typed parameters and return values.
  2. Bài học 2 thử thách Binary Search Find a value in a sorted slice by halving the search range.

7 Đối tượng và lớp 1 bài học

  1. Bài học 1 thử thách Structs Group related values into your own type with named fields.
Học tiếp: Lập trình cơ bản