Created
December 2, 2013 01:14
-
-
Save pepet96/7743392 to your computer and use it in GitHub Desktop.
A + B
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Scanner; | |
| import java.util.Arrays; | |
| import java.io.*; | |
| public class aplusb { | |
| public static void main (String [] args) throws IOException { | |
| InputStreamReader inStream = new InputStreamReader(System.in); | |
| BufferedReader systemIn = new BufferedReader(inStream); | |
| String str = systemIn.readLine(); | |
| String[] str_array = str.split(" "); | |
| String stra = str_array[0]; | |
| String strb = str_array[1]; | |
| int a = Integer.parseInt(stra); | |
| int b = Integer.parseInt(strb); | |
| if (1 <= a && b <= 50) { | |
| int sum = a + b; | |
| System.out.println(sum); | |
| } | |
| else if (1 > a && b > 50) { | |
| System.out.println("not valid"); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment