ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1000. A+B Problem

a + b
Posted by Straider 10 Feb 2014 23:46
import java.util.Scanner;

public class firstexercise{

public static void main(String[]args){
Scanner scanner=new Scanner(System.in);

int c=0;

System.out.println("Введите первое число.");
int a=scanner.nextInt();
System.out.println("Введите второе число.");
int b=scanner.nextInt();

c=a+b;

System.out.println("Ответ = " + c);

}


}
Re: a + b
Posted by nubpun 29 Mar 2014 10:28
ы
Re: a + b
Posted by nubpun 29 Mar 2014 10:28
ы
Re: a + b
Posted by Brian Cheung 21 Apr 2014 20:37
There should be no prompt message and output only answer:

import java.util.Scanner;

public class firstexercise{

public static void main(String[]args){
Scanner scanner=new Scanner(System.in);

int c=0;

int a=scanner.nextInt();
int b=scanner.nextInt();

c=a+b;

System.out.println(c);

}


}