Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. use std::io;
  2.  
  3. fn gets() -> String {
  4. let mut buf = String::new();
  5. io::stdin().read_line(&mut buf).ok();
  6. return buf
  7. }
  8.  
  9. fn main() {
  10. let line = gets();
  11. let mut it = line.split_whitespace().map(|n| n.parse::<i64>().unwrap());
  12. let x = it.next().unwrap();
  13. let a = it.next().unwrap();
  14. let b = it.next().unwrap();
  15. if (x - a).abs() < (x - b).abs() {
  16. println!("A");
  17. } else {
  18. println!("B");
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement