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 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 Samples | Output 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");
}
}
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..