0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

RUSTLANG豆知識

Posted at

Tatsuya-and-Miyuki-mahouka-koukou-no-rettousei-37631808-1280-720.png

1.インプット(input)

    let mut buf= String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let mut num= buf.trim().parse::<usize>().unwrap();

CHAT-GPTのおすすめ

    let std= stdin();
    let mut buff= std.lock().lines();
    let a_and_b: Vec<i32>= buff.next().unwrap().unwrap()
        .split_whitespace()
        .map(|f| f.parse().unwrap())
        .collect();

2. TypeCast


let a= 0_i32;
let b= a as u32;

let string_type= String::from("77");
let number=  string_type.parse::<i32>();
let number2: i32= string_type.parse();

3. test code

$ cargo new  --lib example

cargo testでテストできます!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?