URI Online Judge Solution | 1001 || Simple summation Problem - Online Judge Solution

Latest

It is a free Online judges problems solution list. Here you can find UVA online Judge Solution, URI Online Judge Solution, Code Marshal Online Judge Solution, Spoz Online Judge Problems Solution

Saturday, October 17, 2015

URI Online Judge Solution | 1001 || Simple summation Problem

URI Online Judge Solution | 1001 || Simple summation Problem


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


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

URI Online Judge solution | 1050 | DDD problem

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();                     //take input for A
      B = sc.nextInt();                    //take input for  B
      X = A + B;                           //Basic summation X = A + B
      System.out.print("X = "+X+"\n");    //Hardly advised to give \n at last

   }

}


URI 1001 Solution in C++ language:



#include <iostream>

using namespace std;

int main() {
   int A, B, X;

   cin >> A >> B;                //take input for A and B
   X = A + B;                   //Basic summation X = A + B
   cout << "X = " << X << endl;//Print X in given format and endl is endline or it works linke "\n" in c and java

   return 0;

}



URI 1001 Solution in Python  language:


a = input()
b = input()
X = a + b
print "X = %i" % X

URI 1001 Solution in C# language:


using System; 

class URI {

    static void Main(string[] args) { 
        int A = int.Parse(Console.ReadLine());
        int B = int.Parse(Console.ReadLine());
        int X = A+B;
        Console.WriteLine("X = {0}", 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, URI 1001 in C# language

Simple Solve Technics in C:


This is a  simple program of adding two number . First I've initialize three variables named A, B and X like the way


   int A,B,X;

 And then get the two two integer number( which is A and B )from the user like


   scanf("%d %d", &A, &B);

and get third variable named X and then simply declare that that means we add two number and save that at X variable


X=A+B;

Now ,we print out the X variable which calculate the sum of two  numbers...like this way

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


See a complete video of URI online judge solution 1001- Extremely basic Problems video




Note: 
Here if you don't have create any new line then your program will give you you a presentation error.

No comments:

Post a Comment