Created
January 20, 2018 00:22
-
-
Save j-walk/108def6d6b2fbe30e1808c1c11013036 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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