![](https://imgconvert.csdnimg.cn/aHR0cHM6Ly9pbWcyMDE4LmNuYmxvZ3MuY29tL2Jsb2cvMTMyMjQ5OS8yMDE4MTAvMTMyMjQ5OS0yMDE4MTAwODE3MzA0NjY5NS0xOTc1NzMxOTUucG5n?x-oss-process=image/format,png)
package my_project;
import java.util.Scanner;
public class my_first_class {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
number x1 = new number();
number x2 = new number();
x1.setNum(in.nextInt());
x2.setNum(in.nextInt());
int sum=x1.jieChen()+x2.jieChen();
System.out.println(x1.getNum()+ "! + "+x2.getNum()+"! = "+ sum);
}
}
class number{
private int num;
public int getNum()
{
return num;
}
public void setNum(int num)
{
this.num=num;
}
public int jieChen() //没有static是针对某一对象的
{
int s=1;
for(int i=1;i<=num;i++)
{
s=s*i;
}
return s;
}
}