1. Titel
Lesen Sie vier ganze Zahlen A, B, C, D und berechnen Sie den Wert von (A * B-C * D).
Eingabeformat Es gibt
vier Eingabezeilen: Die erste Zeile enthält die Ganzzahl A, die zweite Zeile enthält die Ganzzahl B, die dritte Zeile enthält die Ganzzahl C und die vierte Zeile enthält die Ganzzahl D.
Ausgabeformat Das
Ausgabeformat ist "DIFERENCA = X", wobei X das Ergebnis von (A * B-C * D) ist.
Datenbereich
−10000 ≤ A, B, C, D ≤ 10000
Eingabebeispiel: Ausgabebeispiel
5 6 7 8
:
DIFERENCA = -26
2. Code
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner sca=new Scanner(System.in);
int a=sca.nextInt(); //读取a,b,c,d;
int b=sca.nextInt();
int c=sca.nextInt();
int d=sca.nextInt();
int ans=a*b-c*d;
System.out.println("DIFERENCA = "+ans);
}
}