URI Online Judge | 1007 Difference (Solution)
Problem Link:
https://www.urionlinejudge.com.br/judge/en/problems/view/1007
Solution:
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 Inputs | Sample Outputs |
5 6 7 8 | DIFERENCA = -26 |
0 0 7 8 | DIFERENCA = -56 |
5 6 -7 8 | DIFERENCA = 86 |
#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
Post a Comment