Study/PS

[BOJ/백준][Rust] 1008 A/B

dys4nt 2023. 6. 18. 14:49

f32로 제출하면 오차범위에 의해서 틀렸다고 채점된다.

1
2
3
4
5
6
7
8
9
10
use std::io;
 
fn main(){
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    let li: Vec<&str> = s.split_whitespace().collect();
    let a = li[0].parse::<f64>().unwrap();
    let b = li[1].parse::<f64>().unwrap();
    println!("{}",a/b)
}
cs