URI Solve 1001:C, C++, Python, Java - Online Judge

Latest

This is an Online Judge Solution Base Site. We can discuss & Solve any contest solution in Programming.

Sunday, September 8, 2019

URI Solve 1001:C, C++, Python, Java

URI Online Judge Solution 1001 - Simple summation  | Beginner
URI Main Problem Link - https://www.urionlinejudge.com.br/
Problem Name: URI Problem 1001
Problem No : URI Problem 1001 Solution
Online Judge : URI Online Judge Solution

Level: Beginner
Solution Language : C, C++, Python, Java



URI Online Judge | 1001

Extremely Basic

Adapted by Neilor Tonin, URI br URI Online Judge Solution : 1001 Extremely Basic (Beginner Problem) Brazil
Timelimit: 1
Read 2 integer values and store them in variables, named A and B and make the sum of these two variables, assigning its result to the variable X. Print X as shown below. Don’t present any message beyond what is being specified and don’t forget to print the end of line after the result, otherwise you will receive “Presentation Error”.

Input

The input file contain 2 integer values.

Output

Print the variable X according to the following example, with a blank space before and after the equal signal. ‘X’ is uppercase and you have to print a blank space before and after the ‘=’ signal.

Input SamplesOutput Samples
10
9
X = 19
-10
4
X = -6
15
-7
X = 8


Solution:

URI Solution 1001 Code in C:


#include<stdio.h>
int main()
{
   int A,B,X;

   scanf("%d %d", &A, &B);
   X=A+B;

   printf("X = %d\n",X);

   return 0;
}

URI 1001 Solution in Java language:

import java.util.Scanner;
public class Main {
 public static void main(String[] args) {
int a, b, x;
      Scanner sc = new Scanner(System.in);
      a = sc.nextInt();                     
      b = sc.nextInt();                    
      x = a + b;                           
      System.out.print("X = "+x+"\n");    

   }

}

URI 1001 Solution in C++ language:


#include <iostream>

using namespace std;

int main() {
   int a, b, x;

   cin >> a >> b;
   x = a + b;
   cout << "X = " << x << endl;
   return 0;

}


URI 1001 Solution in Python  language:

a = input()

b = input()

X = a + b

print "X = %i" % X


Tags: Uri solve , Uri solution, URI oj Solve, URI Online Judge Solution list, URI 1001 Solution, URI simple summation problem, URI 1001 in C, URI 1001 in C++, URI 1001 Solution in java, URI 1001 solution in Python

No comments:

Post a Comment

Thanks..