use std::io;
fn main() {
println!("hello gachi");
println!("you are gay");
let mut x: u32 = 200;
println!("fisting is: {} bucks", x);
x = 300;
println!("fisting is: {} bucks", x);
let mut x: u32 = x + 1;
println!("fisting is: {} bucks", x);
x = x + 1;
println!("fisting is: {} bucks", x);
{
let x = 400; // Коментар
println!("fisting is: {} bucks", x);
}
let y = "300";
println!("fisting is: {} bucks", y);
const FISTING_BILLY: u32 = 500;
println!("Billy {}", FISTING_BILLY);
let a: i32 = 2;
println!("{}", a);
let a: u32 = 970;
println!("{}", a);
let fisting_billy: bool = true;
println!("Billy fisting ass? {}", fisting_billy);
let sex: char = 'M';
println!("{}", sex);
let mut gay: (i32, bool, char) = (300, false, 's'); // Кортеж із трьома елементами
gay = (10, true, 'e');
println!("{}", gay.0);
let mut arr: [i32; 5] = [1, 2, 3, 4, 5];
println!("you are gay {:?}", arr); // Виведення масиву
arr[4] = 3;
println!("you are gay {:?}", arr); // Виведення зміненої версії масиву
println!("who are gay?");
// println!("Enter you name");
// let mut nameOfGay = String::new();
// io::stdin().read_line(&mut nameOfGay);
// println!("{} are gay", nameOfGay);
let c = x % a;
println!("{}", c);
// Робота з різними типами
let j: u32 = 15;
let f: f64 = 100_000.0;
let g = (j as f64) / f;
println!("{}", g);
// Читання з консолі
let mut input = String::new();
io::stdin()
.read_line(&mut input)
.expect("expected to read the line");
// Перетворення введених даних у ціле число
match input.trim().parse::() {
Ok(int_input) => {
println!("{}", int_input + 2);
}
Err(_) => {
println!("Error: not a valid number");
}
}
let gayName = "Billy";
if gayName == "Billy" {
println!("Billy Harington");
}
some_fun(10, 2);
}
fn some_fun(x: i32, y: i32){
println!("The sum is: {}", x + y);
}
fn main() {
println!("hello gachi");
println!("you are gay");
let mut x: u32 = 200;
println!("fisting is: {} bucks", x);
x = 300;
println!("fisting is: {} bucks", x);
let mut x: u32 = x + 1;
println!("fisting is: {} bucks", x);
x = x + 1;
println!("fisting is: {} bucks", x);
{
let x = 400; // Коментар
println!("fisting is: {} bucks", x);
}
let y = "300";
println!("fisting is: {} bucks", y);
const FISTING_BILLY: u32 = 500;
println!("Billy {}", FISTING_BILLY);
let a: i32 = 2;
println!("{}", a);
let a: u32 = 970;
println!("{}", a);
let fisting_billy: bool = true;
println!("Billy fisting ass? {}", fisting_billy);
let sex: char = 'M';
println!("{}", sex);
let mut gay: (i32, bool, char) = (300, false, 's'); // Кортеж із трьома елементами
gay = (10, true, 'e');
println!("{}", gay.0);
let mut arr: [i32; 5] = [1, 2, 3, 4, 5];
println!("you are gay {:?}", arr); // Виведення масиву
arr[4] = 3;
println!("you are gay {:?}", arr); // Виведення зміненої версії масиву
println!("who are gay?");
// println!("Enter you name");
// let mut nameOfGay = String::new();
// io::stdin().read_line(&mut nameOfGay);
// println!("{} are gay", nameOfGay);
let c = x % a;
println!("{}", c);
// Робота з різними типами
let j: u32 = 15;
let f: f64 = 100_000.0;
let g = (j as f64) / f;
println!("{}", g);
// Читання з консолі
let mut input = String::new();
io::stdin()
.read_line(&mut input)
.expect("expected to read the line");
// Перетворення введених даних у ціле число
match input.trim().parse::() {
Ok(int_input) => {
println!("{}", int_input + 2);
}
Err(_) => {
println!("Error: not a valid number");
}
}
let gayName = "Billy";
if gayName == "Billy" {
println!("Billy Harington");
}
some_fun(10, 2);
}
fn some_fun(x: i32, y: i32){
println!("The sum is: {}", x + y);
}