Thursday, March 31, 2016

URI 1007 in C, C++ and in java language || Difference

Main link in URI Online Judge :

Go URI 1007 No Problem

Read four integer values named A, B, C and D. Calculate and print the difference of product A and B by the product of C and D (A * B - C * D).

Input

The input file contains 4 integer values.

Output

Print DIFERENCA (DIFFERENCE in Portuguese) with all the capital letters, according to the following example, with a blank space before and after the equal signal.
Input SamplesOutput Samples
5
6
7
8
DIFERENCA = -26
0
0
7
8
DIFERENCA = -56
5
6
-7
8
DIFERENCA = 86

Solution in C language :

  1. #include<stdio.h>
  2. int main()
  3. {
  4. int a, b, c, d;
  5. scanf("%d%d%d%d", &a, &b, &c, &d);
  6. printf("DIFERENCA = %d\n", a * b - c * d);
  7. return 0;
  8. }
URI Onilne judge solution 1007 in C, C++ execution

Solution in C++ language :

#include<iostream> using namespace std; int main() { int a, b, c, d; cin >> a >> b >> c >> d; cout << "DIFERENCA = " <<a * b - c * d << endl; return 0; }


Solution in Java language : 


  1. import java.util.Scanner;
  2. public class URI_1007 {
  3. public static void main(String[] args) {
  4. Scanner input =new Scanner(System.in);
  5. int a, b, c, d, difference;
  6. a = input.nextInt();
  7. b = input.nextInt();
  8. c = input.nextInt();
  9. d = input.nextInt();
  10. difference = a * b - c * d;
  11. System.out.print("DIFERENCA = "+ difference +"\n");
  12. }
  13. }
URI 1007 in java execution





To solve more problem in URI solution judge of beginner level at a glance , go to :




To download URI many problem in java language in java language :
Go to


URI 1007 in C, C++ and java solution is present here. I think there will be no problem to clear the simple differencial problem. If you face any problem to this, you can send us a comment please. We will help you as we can.







No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.