Sunday, October 20, 2013

uri OJ 1007 c++ solution

uri OJ 1007 problem link: http://www.urionlinejudge.com.br/judge/en/problems/view/1007

uri OJ 1007 problem. URI Online Judge | 1007

Difference

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 InputSample Output
5
6
7
8
DIFERENCA = -26
my c++ solution to uri OJ 1007 problem: http://ideone.com/rRC7Gx
#include <iostream>
using namespace std;

int main() {
// your code goes here
int A, B, C, D, DIFERENCA;
cin>>A>>B>>C>>D;
cout<<"DIFERENCA = "<<((A*B)-(C*D))<<endl;
return 0;
}

No comments:

Post a Comment