我目前正在开发一个程序,该程序必须包含所有可能的计算示例。我为数字、差、积、模、商和总和做了一个类。我正在做这样的事情
Difference(Number first_number,Number second_number){
s1 = first_number + second_number;
}
Difference(Number first_number, Product first_difference){
s1 = first_number + first_difference
}
Difference(Product first_difference, Number first_number){
s1 = first_product + first_number;
}
Difference(Product first_difference, Product second_difference){
s1 = first_difference + second_difference;
}
Difference(Number first_number, Quotient first_difference){
s1 = first_number + first_difference;
}
Difference(Quotient first_difference, Number first_number){
s1 = first_difference + first_number;
}
Difference(Quotient first_difference, Quotient second_difference){
s1 = first_difference + second_difference;
}
Difference(Number first_number, Difference first_difference){
s1 = first_number + first_difference;
}
Difference(Difference first_difference, Number first_number){
s1 = first_number + first_difference;
}
Difference(Difference first_difference, Difference second_difference){
s1 = first_difference + second_difference;
}
Difference(Number first_number, Sum first_Difference){
s1 = first_number + first_Difference;
}
Difference(Sum first_Difference, Number first_number){
s1 = first_Difference + first_number;
}
Difference(Sum first_Difference, Sum second_Difference){
s1 = first_Difference + second_Difference;
}
Difference(Number first_number, Modulus first_modulus ){
s1 = first_number + first_modulus;
}
Difference(Modulus first_modulus, Number first_number){
s1 = first_number + first_ modulus;
}
Difference(Modulus first_modulus, Modulus second_modulus){
s1 = first_modulus + second_modulus;
}
Difference(Sum first_Difference, Product first_difference){
s1 = first_Difference + first_difference;
}
Difference(Product first_difference, Sum first_Difference){
s1 = first_difference + first_Difference;
}
Difference(Sum first_Difference, Quotient first_difference){
s1 = first_Difference + first_difference;
}
Difference(Quotient first_difference, Sum first_Difference){
s1 = first_difference + first_Difference;
}
Difference(Sum first_Difference, Difference first_difference){
s1 = first_Difference + first_difference;
}
Difference(Difference first_difference, Sum first_Difference){
s1 = first_Difference + first_difference;
}
Difference(Sum first_Difference, Modulus first_modulus ){
s1 = first_Difference + first_modulus;
}
Difference(Modulus first_modulus, Sum first_Difference){
s1 = first_Difference + first_modulus;
}
Difference(Difference first_difference, Quotient first_difference){
s1 = first_difference + first_difference;
}
Difference(Quotient first_difference, Difference first_difference){
s1 = first_difference + first_difference;
}
Difference(Product first_difference, Quotient first_difference){
s1 = first_difference + first_difference;
}
Difference(Quotient first_difference, Product first_difference){
s1 = first_difference + first_difference;
}
Difference(Quotient first_difference, Modulus first_modulus){
s1 = first_difference + first_modulus;
}
Difference(Modulus first_modulus, Quotient first_difference){
s1 = first_difference + first_modulus;
}
Difference(Difference first_difference, Quotient first_difference){
s1 = first_difference + first_difference;
}
Difference(Quotient first_difference, Difference first_difference){
s1 = first_difference + first_difference;
}
Difference(Difference first_difference, Modulus first_modulus){
s1 = first_difference + first_modulus;
}
Difference(Modulus first_modulus, Difference first_difference){
s1 = first_modulus + first_difference;
}
Difference(Difference first_difference, Modulus first_modulus){
s1 = first_difference + first_modulus;
}
Difference(Modulus first_modulus, Difference first_difference){
s1 = first_difference + first_modulus;
}
以确保我的主要课程有各种可能的组合方式。有什么方法可以提高效率吗?我厌倦了一遍又一遍地写这个。