fork download
  1. /* package whatever; // don't place package name! */
  2. import java.util.Scanner;
  3. /* The class name doesn't have to be Main, as long as the class is not public. */
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. Scanner numberInputReader = new Scanner (System.in);
  9.  
  10. int num1;
  11. num1= numberInputReader.nextInt();
  12. int num2;
  13. num2= numberInputReader.nextInt()+ num1;
  14. System.out.println( " My number is " + num2);
  15. num1=num1-1;
  16.  
  17. System.out.println( "And the number minus 1 equals " + num1);
  18.  
  19. }
  20. }
Success #stdin #stdout 0.05s 246144KB
stdin
10,000
500
stdout
 My number is 10500
And the number minus 1 equals 9999