Skip to content

Instantly share code, notes, and snippets.

@PreSoichiSumi
Created April 26, 2016 08:20
Show Gist options
  • Save PreSoichiSumi/05efded05cc91b948af623609f9763f9 to your computer and use it in GitHub Desktop.
Save PreSoichiSumi/05efded05cc91b948af623609f9763f9 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int A=sc.nextInt();
int B=sc.nextInt();
int sound=0;
sound=Math.abs(A)+Math.abs(B-A)+Math.abs(B);
System.out.println(sound);
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment