Skip to content

Instantly share code, notes, and snippets.

@pepet96
Created December 2, 2013 01:14
Show Gist options
  • Save pepet96/7743392 to your computer and use it in GitHub Desktop.
Save pepet96/7743392 to your computer and use it in GitHub Desktop.
A + B
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