Skip to content

Instantly share code, notes, and snippets.

@j-walk
Created January 20, 2018 00:28
Show Gist options
  • Save j-walk/6374ac8fffdfb97f9c80815c9df71d4c to your computer and use it in GitHub Desktop.
Save j-walk/6374ac8fffdfb97f9c80815c9df71d4c to your computer and use it in GitHub Desktop.
use std::io;
fn main() {
let mut stdin = io::stdin();
let input = &mut String::new();
input.clear();
println!("Specific impulse: ");
stdin.read_line(input).unwrap();
let specific_impulse = input.trim().parse::<i32>().unwrap();
input.clear();
println!("Total mass (tons): ");
stdin.read_line(input).unwrap();
let total_mass = input.trim().parse::<i32>().unwrap();
input.clear();
println!("Dry mass (tons): ");
stdin.read_line(input).unwrap();
let dry_mass = input.trim().parse::<i32>().unwrap();
let delva_v = (9.81 * specific_impulse as f32) * (total_mass as f32 / dry_mass as f32).ln();
println!("DeltaV: {}", delva_v);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment