import java.util.Scanner; public class jia_jian_cheng_chu_01 { public static void main(String[] args) { shu num; num=new shu(); Scanner sc= new Scanner(System.in); System.out.println("请输入第一个数字"); num.a=sc.nextInt(); System.out.println("请输入第二个数字"); num.b=sc.nextInt(); System.out.println("两个数字相加的结果是:"); System.out.println(num.a+num.b); System.out.println("两个数字相减的结果是:"); System.out.println(num.a-num.b); System.out.println("两个数字相乘的结果是:"); System.out.println(num.a*num.b); System.out.println("两个数字相除的结果是:"); System.out.println(num.a/num.b); } static class shu{ int a,b; void jjcc(int s){ System.out.println(s); } } }
java小白——java实现两个数的加减乘除
最新推荐文章于 2023-11-06 15:38:10 发布