四則運算,這邊示範加減乘除。
public class first
{
public
static void main(String[] args)
{
int
a=10;
System.out.println("a
= "+a);
System.out.println("a
+ a"+" = "+(a+a));
System.out.println("a
- a"+" = "+(a-a));
System.out.println("a
* a"+" = "+(a*a));
System.out.println("a
/ a"+" = "+(a/a));
}
}
沒有留言:
張貼留言