Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,21 @@
fn main() -> std::io::Result<()> {
print!("Enter temperature in Kelvin to convert: ");
let mut input = String::new();
std::io::stdin().read_line(&mut input)?;
match input.trim().parse::<f32>() {
Ok(kelvin) => {
if kelvin < 0.0 {
println!("Negative Kelvin values are not acceptable.");
} else {
println!("{} K", kelvin);
println!("{} °C", kelvin - 273.15);
println!("{} °F", kelvin * 1.8 - 459.67);
println!("{} °R", kelvin * 1.8);
}
}
_ => println!("Could not parse the input to a number."),
}
Ok(())
}