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?

Rust lang) ABC379 A - Cyclic

Posted at

code

use std::io::{stdin, BufRead};

fn main(){
    let std= stdin();
    let mut buf= std.lock().lines();
    let str_input= buf.next().unwrap().unwrap();
    let number: u64= str_input.parse().unwrap();
    let chars: Vec<char>= number.to_string()
        .chars()
        .collect();

    let string_one= format!("{}{}{}", chars[1], chars[2], chars[0]);
    let string_two= format!("{}{}{}", chars[2], chars[0], chars[1]);

    let number_1: u64= string_one.parse().unwrap();
    let number_2: u64= string_two.parse().unwrap();

    println!("{} {}", number_1, number_2);
}

1.PNG

ref

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?