mirror of
https://github.com/theoludwig/programming-challenges.git
synced 2024-12-08 00:45:29 +01:00
feat(solutions): add sorting-algorithms/rust/function
This commit is contained in:
parent
6d12750ea1
commit
a18d9045dd
@ -0,0 +1,3 @@
|
||||
# sorting-algorithms/rust/function
|
||||
|
||||
Created by [@Divlo](https://github.com/Divlo) on 8 March 2022.
|
@ -0,0 +1,15 @@
|
||||
use std::io::{self, BufRead};
|
||||
|
||||
fn main() {
|
||||
let mut numbers: Vec<i64> = Vec::new();
|
||||
let stdin = io::stdin();
|
||||
for line in stdin.lock().lines().skip(1) {
|
||||
let line = line.unwrap();
|
||||
let number: i64 = line.trim().parse().unwrap();
|
||||
numbers.push(number);
|
||||
}
|
||||
numbers.sort();
|
||||
for number in numbers {
|
||||
println!("{}", number);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user