fork download
  1. fn main() {
  2. let x = 42;
  3. println!("{}", x);
  4. let s = "hoge";
  5. println!("{}", s);
  6. let char_list = vec!['w', 'o', 't', 's', 'u', 's', 'h', 'i'];
  7. println!("{}", char_list.into_iter().collect::<String>());
  8. let y = 0;
  9. let z = -1;
  10. println!("{} {} {}", x, y, z);
  11. let xs = vec![3, 1, 4, 1, 5];
  12. println!(
  13. "{}",
  14. xs.iter()
  15. .map(std::string::ToString::to_string)
  16. .collect::<Vec<_>>()
  17. .join(" ")
  18. );
  19. println!(
  20. "{}",
  21. xs.iter()
  22. .map(std::string::ToString::to_string)
  23. .collect::<Vec<_>>()
  24. .join("\n")
  25. );
  26. }
  27.  
Success #stdin #stdout 0s 4372KB
stdin
Standard input is empty
stdout
42
hoge
wotsushi
42 0 -1
3 1 4 1 5
3
1
4
1
5