diff --git a/lab3/zad1/rand_select/src/main.rs b/lab3/zad1/rand_select/src/main.rs index 2ed99e7..0eeb106 100644 --- a/lab3/zad1/rand_select/src/main.rs +++ b/lab3/zad1/rand_select/src/main.rs @@ -48,7 +48,13 @@ fn main() -> io::Result<()> { println!("end state: {:?}", list); let mut insertion = InsertionSort::new(false); println!("sorted array: {:?}", insertion.sort(&input_list)); - println!("{} order statistic: {}", order_statistic, result); + let ordinal_indicator = match order_statistic { + 1 => "st", + 2 => "nd", + 3 => "rd", + _ => "th", + }; + println!("{}{} order statistic: {}", order_statistic, ordinal_indicator, result); } println!("swaps: {}", randomized.num_swap()); diff --git a/lab3/zad1/select/src/main.rs b/lab3/zad1/select/src/main.rs index 44607f7..40f132c 100644 --- a/lab3/zad1/select/src/main.rs +++ b/lab3/zad1/select/src/main.rs @@ -48,7 +48,13 @@ fn main() -> io::Result<()> { println!("end state: {:?}", list); let mut insertion = InsertionSort::new(false); println!("sorted array: {:?}", insertion.sort(&input_list)); - println!("{} order statistic: {}", order_statistic, result); + let ordinal_indicator = match order_statistic { + 1 => "st", + 2 => "nd", + 3 => "rd", + _ => "th", + }; + println!("{}{} order statistic: {}", order_statistic, ordinal_indicator, result); } println!("swaps: {}", normal.num_swap());