Home / Problem Solving / URI Online Judge / URI Online Judge Solution 1003

URI Online Judge Solution 1003

URI Online Judge Solution 1003

URI Online Judge Solution 1003 using JAVA,URI Online Judge Solution 1003 using C, URI Online Judge Solution 1003 using C++, URI Online Judge Solution 1003 using C#, URI Online Judge Solution 1003 using Python, URI Online Judge Solution 1003 using Kotlin, URI Online Judge Solution 1003 using Ruby.

URI Online Judge Solution
URI Online Judge Solution 1003

URI Online Judge Solution 1003 : Simple Sum

Read two integer values, in this case, the variables A and B. After this, calculate the sum between them and assign it to the variable SOMA. Write the value of this variable.

Input :

The input file contains 2 integer numbers.

Output :

Print the variable SOMA with all the capital letters, with a blank space before and after the equal signal followed by the corresponding value to the sum of A and B. Like all the problems, don’t forget to print the end of line, otherwise you will receive “Presentation Error”

Input Samples Output Samples
30 10 SOMA = 40
-30 10 SOMA = -20
0 0 SOMA = 0

Source : URI Online Judge

URI Online Judge Solution 1003 Using JAVA

import java.io.IOException;
import java.util.Scanner; 
/**
 * IMPORTANT: 
 *      O nome da classe deve ser "Main" para que a sua solução execute
 *      Class name must be "Main" for your solution to execute
 *      El nombre de la clase debe ser "Main" para que su solución ejecutar
 */
public class Main {
 
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        int A = in.nextInt();
        int B = in.nextInt();
        int SOMA = A + B;
        System.out.println("SOMA = "+ SOMA); 
        /**
         * Escreva a sua solução aqui
         * Code your solution here
         * Escriba su solución aquí
         */
 
    }
 
}

URI Online Judge Solution 1003 Using C

#include<stdio.h>
int main(){
    int A, B;
    scanf("%d%d", &amp;A, &amp;B);
    printf("SOMA = %d\n", A+B);
    return 0;
}

URI Online Judge Solution 1003 Using C++

#include<iostream>
using namespace std;

int main(){
    int A, B;
    cin >> A >> B ;                        //scanf("%d%d", &amp;A,&amp;B);
    cout << "SOMA = " << A+ B << endl;    // printf("SOMA = %d\n", A+B);
    return 0;
}

Thank you for reading this post. If you are also ambitious to write blogs and want to improve your writing skills then create an account to this site and start writing new posts. You can also generate traffique for your site by writing your site’s post and link . See the rules of writing new post to know more. Also if you have any Question about this post or anything then comment below or mail me.

0%

User Rating: Be the first one !

Report this post if contains any Adult Content or Plagiarism :

About Md. Sabbir Al Mamon

I am Md.Sabbir Al Mamon. Now I'm studying CSE in BRAC University.

Leave a Reply