Solution (Simple Sum) of URI online judge problem 1003 by c++

Read two variables A and B. Next, calculate the sum between them and assign it to the variable SOMA. Write the value of this variable.

Input

The input file will contain 2 integer numbers.

Output

Print SOMA according to the following example, with a blank space before and after the equal signal.

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

Solution:

#include<iostream>

using namespace std;

int main(){
int a, b, soma;
cin>>a>>b;
soma=a+b;
cout<<“SOMA = “<<soma<<endl;
return 0;
}

Advertisements
Categories: URI | Leave a comment

Post navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.