URI Online Judge | 1007 Difference (Solution)

Problem Link:
https://www.urionlinejudge.com.br/judge/en/problems/view/1007

URI Online Judge | 1007

Difference

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
Make a simple program that reads four variables named A, B, C and D. Calculate and print the difference of the product of A and B with the product of C and D (A * B - C * D).

Input

The input file contains 4 integer numbers.

Output

Print DIFERENCA (DIFFERENCE in portuguese) according to the following example, with a blank space before and after the equal signal.
Sample InputsSample Outputs
5
6
7
8
DIFERENCA = -26
0
0
7
8
DIFERENCA = -56
5
6
-7
8
DIFERENCA = 86
Solution:
#include<stdio.h>
int main(){
    int a,b,c,d;
    scanf("%d %d %d %d",&a,&b,&c,&d);
    printf("DIFERENCA = %d\n",((a*b)-(c*d)));
    return 0;

}

Comments

Popular posts from this blog

URI Online Judge | 1036 Bhaskara's Formula (Solution)

URI Online Judge | 1043 Triangle (Solution)

URI Online Judge | 1042 Simple Sort (Solution)