TPK algorithm: Difference between revisions

Content deleted Content added
Ricvelozo (talk | contribs)
Ricvelozo (talk | contribs)
Line 109:
 
<syntaxhighlight lang="Rust" line>
use std::{io::{self, preludeiter::*zip};
 
fn f(t: f64) -> f64 {
Line 117:
fn main() {
let mut a = [0f64; 11];
for (t, input) in a.iter_mut().zip(&mut a, io::stdin().lock().lines()) {
*t = input.unwrap().parse().unwrap();
}
 
a.into_iteriter().enumerate().rev().for_each(|(i, &t)| match f(t) {
y if y > 400.0 => println!("{i} TOO LARGE"),
y => println!("{i} {y}"),