Search
 
SCRIPT & CODE EXAMPLE
 

RUST

rust enter number from keyboard / stdin

use std::io;

// Request number
println!("Enter number? ");
let mut input = String::new();
io::stdin().read_line(&mut input).expect("Failed to read line");
let bint: i32 = input.trim()
  .parse()
  .ok()
  .expect("Program only processes numbers, Enter number");    
println!("Square {}", bint * bint); // use number
Comment

PREVIOUS NEXT
Code Example
Rust :: armanriazi•rust•thread•recv•try_recv 
Rust :: stringify! in rust 
Rust :: rustlang how to edit project names 
Rust :: rust spinning rod animation in text 
Rust :: Read a floating point number from stdin 
Rust :: armanriazi•rust•error•[E0369]: binary operation `=` cannot be applied to type `T` 
Rust :: armanriazi•rust•type•wrapper•vs•clone 
Rust :: armanriazi•rust•concept•oop•state•pattern 
Rust :: rust Clean way to get Option::unwrap_or_else behaviour with an Option<&T 
Rust :: rust what does the double colon mean? 
Rust :: armanriazi•rust•ref•move 
Rust :: macro_rules! 
Rust :: armanriazi•rust•concept•jargon 
Rust :: rust string split 
Lua :: roblox jsonencode 
Lua :: lua for each in table 
Lua :: roblox make debounce 
Lua :: lua globals 
Lua :: lua click button 
Lua :: lua while loops 
Lua :: loop roblox studio 
Lua :: lua script 
Lua :: roblox lua get game place id 
Lua :: how to make a day/night script roblox 
Lua :: difference between roblox and minecraft 
Lua :: lua print hi 
Matlab :: matlab delete file 
Matlab :: alternative from two vectors matlab 
Basic :: virtualbox 256 vram 
Elixir :: elixir string to date 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =