用JAVA编写 输入2个整数 num1 和 num2,计算并输出它们的和、差、积、商与余数.
用JAVA编写 输入2个整数 num1 和 num2,计算并输出它们的和、差、积、商与余数.
程序填空,不要改变与输入输出有关的语句.
输入2个整数 num1 和 num2,计算并输出它们的和、差、积、商与余数.
输入输出示例:括号内是说明
输入
5 3 (num1=5,num2=3)
输出
5+3=8
5-3=2
5*3=15
5/3=1
5%3=2
import java.util.Scanner;
public class Test20010{
public static void main(String args[]){
\x05 int num1,num2;
\x05 Scanner in=new Scanner(System.in);
\x05 num1=in.nextInt();
\x05 num2=in.nextInt();
\x05 /*------------------------*/
}
}
import java.util.Scanner;
public class Test20010{
public static void main(String args[]){
\x05 int num1,num2;
\x05 Scanner in=new Scanner(System.in);
\x05 num1=in.nextInt();
\x05 num2=in.nextInt();
\x05 /*------------------------*/
\x05 int sum = num1 + num2;
\x05 int sub = num1 - num2;
\x05 long mul = num1 * num2;
\x05 int div = num1 / num2;
\x05 int mod = num1 % num2;
\x05
\x05 System.out.println(num1 + " + " + num2 + " = " + sum);
\x05 System.out.println(num1 + " - " + num2 + " = " + sub);
\x05 System.out.println(num1 + " * " + num2 + " = " + mul);
\x05 System.out.println(num1 + " / " + num2 + " = " + div);
\x05 System.out.println(num1 + " % " + num2 + " = " + mod);
\x05 //Add ended
}
}