Created
December 2, 2013 00:55
-
-
Save pepet96/7743196 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 aandb { | |
| 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; | |
| int subs = a - b; | |
| int multi = a*b; | |
| int quoti = a/b; | |
| int mod = a%b; | |
| System.out.println(sum); | |
| System.out.println(subs); | |
| System.out.println(multi); | |
| System.out.println(quoti); | |
| System.out.println(mod); | |
| } | |
| 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