#![allow(unused)]
fn main() {
use std::io;
}
#![allow(unused)]
fn main() {
io::stdin()
.read_line(&mut guess)
.expect("Failed to read line");
}
#![allow(unused)]
fn main() {
// #define ABC 40 * 60 * 3
const ABC: u32 = 60 * 60 * 3;
}
#![allow(unused)]
fn main() {
use rand::Rng;
let secret_number = rand::thread_rng().gen_range(1..=100);
}
#![allow(unused)]
fn main() {
use std::cmp::Ordering;
match guess.cmp(&secret_number) {
Ordering::Less => println!("Too small!"),
Ordering::Greater => println!("Too big!"),
Ordering::Equal => println!("You win!"),
}
}
#![allow(unused)]
fn main() {
let guess: u32 = "42".parse().expect("Not a number!");
}
#![allow(unused)]
fn main() {
if number < 5 {
println!("condition was true");
} else {
println!("condition was false");
}
}
#![allow(unused)]
fn main() {
let number = if condition { 5 } else { 6 };
}
#![allow(unused)]
fn main() {
let result = loop {
counter += 1;
if counter == 10 {
break counter * 2;
}
};
}
fn main() {
let mut count = 0;
'counting_up: loop {
println!("count = {count}");
let mut remaining = 10;
loop {
println!("remaining = {remaining}");
if remaining == 9 {
break;
}
if count == 2 {
break 'counting_up;
}
remaining -= 1;
}
count += 1;
}
println!("End count = {count}");
}
#![allow(unused)]
fn main() {
while number != 0 {}
}
#![allow(unused)]
fn main() {
let a = [10, 20, 30, 40, 50];
for element in a {}
for number in (1..4).rev() {}
}