added the things
This commit is contained in:
commit
72ce766c50
4 changed files with 65 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/target
|
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rust_dumping-ground"
|
||||||
|
version = "0.1.0"
|
8
Cargo.toml
Normal file
8
Cargo.toml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[package]
|
||||||
|
name = "rust_dumping-ground"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
49
src/main.rs
Normal file
49
src/main.rs
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
use std::io;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
//thomas gay
|
||||||
|
println!("Hello, world!"); //println! is a macro
|
||||||
|
let mut x = 69;
|
||||||
|
println!("asdasdasd{0}{0}", x);
|
||||||
|
fn thomasfunc() {
|
||||||
|
//thomas gay
|
||||||
|
println!("father of lies")
|
||||||
|
}
|
||||||
|
thomasfunc();
|
||||||
|
x = x + 1;
|
||||||
|
println!("{}", x);
|
||||||
|
|
||||||
|
while x != 1 {
|
||||||
|
|
||||||
|
println!("number = {0}", x);
|
||||||
|
|
||||||
|
if (x % 2) == 0 {
|
||||||
|
|
||||||
|
println!("even{0}", x);
|
||||||
|
x = x / 2;
|
||||||
|
} else {
|
||||||
|
x = (3 * x) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
let mut thebestx:f32 = 0.0;
|
||||||
|
let mut thebestx2:f32 = 0.0;
|
||||||
|
let a:f32 = 1.0;
|
||||||
|
let b:f32 = 2.0;
|
||||||
|
let c:f32 = -3.0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
thebestx = (-b + (b.powf(2.0f32) - 4.0f32 * a * c).sqrt())/(2.0f32 * a);
|
||||||
|
thebestx2 = (-b - (b.powf(2.0f32) - 4.0f32 * a * c).sqrt())/(2.0f32 * a);
|
||||||
|
println!("x+={0} x-={1} a={2} b={3} c={4}", thebestx, thebestx2, a, b ,c)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue