- import java.io.Console;
- class HelloWorld
- {
- public static void main(String[] args)
- {
- int a;
- int b;
- Console c=System.console();
- a=Integer.parseInt(c.readLine("enter a:"));
- b=Integer.parseInt(c.readLine("enter b:"));
- System.out.println("a+b="+(a+b));
- System.out.println("a-b="+(a-b));
- System.out.println("a*b="+(a*b));
- System.out.println("a/b="+(a/b));
- System.out.println("a%b="+(a%b));
- }
- }
複製代碼 |