Official

A - Determinant Editorial by tatyam


プログラミングの学習を始めたばかりで何から手をつけるべきかわからない方は、まずは「practicecontest」(https://atcoder.jp/contests/practice/) の問題A「Welcome to AtCoder」をお試しください。言語ごとに解答例が掲載されています。

この問題では、 \(a,b,c,d\) を入力し、 \(a \times d - b \times c\) を出力すれば良いです。

回答例 (C++)

#include <iostream>
using namespace std;

int main(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << a * d - b * c << endl;
}

回答例 (Python)

a, b = map(int, input().split())
c, d = map(int, input().split())
print(a * d - b * c)

posted:
last update: