This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.io.*; | |
class Main { | |
public static void main(String[] args) throws IOException { | |
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); | |
String[] input = in.readLine().split(" "); | |
long a = Integer.parseInt(input[0]); | |
long b = Integer.parseInt(input[1]); | |
System.out.println((a+b)*(a-b)); | |
} | |
} |
EASY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let input = readLine()!.split(separator: " ").map { Int($0)! } | |
let a = input.first! | |
let b = input.last! | |
print((a+b)*(a-b)) |