mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-06-21 00:19:41 +02:00
.github
dev
exercises
00_intro
01_variables
02_functions
README.md
functions1.rs
functions2.rs
functions3.rs
functions4.rs
functions5.rs
03_if
04_primitive_types
05_vecs
06_move_semantics
07_structs
08_enums
09_strings
10_modules
11_hashmaps
12_options
13_error_handling
14_generics
15_traits
16_lifetimes
17_tests
18_iterators
19_smart_pointers
20_threads
21_macros
22_clippy
23_conversions
README.md
quiz1.rs
quiz2.rs
quiz3.rs
rustlings-macros
src
tests
.editorconfig
.gitignore
.markdownlint.yml
CHANGELOG.md
CONTRIBUTING.md
Cargo.lock
Cargo.toml
LICENSE
README.md
info.toml
oranda.json
9 lines
136 B
Rust
9 lines
136 B
Rust
fn main() {
|
|
let answer = square(3);
|
|
println!("The square of 3 is {}", answer);
|
|
}
|
|
|
|
fn square(num: i32) -> i32 {
|
|
num * num;
|
|
}
|