10 lines
339 B
Rust
10 lines
339 B
Rust
use crate::errors::RunError;
|
|
|
|
pub fn scan(memory: &mut Vec<u16>) {
|
|
let mut input = String::new();
|
|
|
|
std::io::stdin().read_line(&mut input).expect(&format!("{}", RunError::FailToReadLineFromConsole));
|
|
|
|
let num = input.trim().parse().expect(&format!("{}", RunError::InvalidInputUShortInt));
|
|
memory.push(num);
|
|
} |