public class ufo {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Yun cm=new Yun();
int num1=100,num2=35;
System.out.println(cm.add(num1,num2));
System.out.println(cm.sub(num1,num2));
System.out.println(cm.mul(num1,num2));
System.out.println(cm.chu(num1,num2));
System.out.println(cm.ping(num1));
System.out.println(cm.ping(num2));
}
}
class Yun{
int num1,num2;
int add(int num1,int num2){
return num1+num2;
}
int sub(int num1,int num2){
return num1-num2;
}
int mul(int num1,int num2){
return num1*num2;
}
int chu(int num1,int num2){
return num1/num2;
}
int ping(int num1){
return num1*num1;
}
}
四则运算
最新推荐文章于 2022-11-18 19:34:20 发布