Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Myeclipse wrote a mathematician's class with the method:
Myeclipse wrote a mathematician's class with the method:
Public? Class? s? {

//? Pass in two integers, compare them, and return the maximum of the two numbers.

Public? int? get(int? num 1,int? num2){

Return? Math.max(num 1,? num 2);

}

//? A method of passing in three double-precision data, comparing them, and returning the smallest of the three numbers.

Public? Double? Get (double? dou 1,double? dou2,double? dou3){

Return? Math.min(Math.min(dou 1,? dou2)、dou 3);

}

//? Pass in an integer and return the single digits of the integer.

Public? int? get(int? num){

Return? num % 10;

}

//? A method of passing in an integer and adding the cube of the integer back.

Public? int? get 1(int? num){

Return? (int)? Math.pow(num,3);

}

//Pass in a positive integer. How to calculate the sum added to this integer from 1? For example, if you enter a 5, you will calculate 1+2+3+4+5= 15, and finally return 15.

Public? int? get2(int? num){

int? x? =? 0;

For what? (int? Me? =? 0; ? Me? & lt=? num? i++)? {

x? +=? Me;

}

Return? x;

}

//Pass in an integer array and return the sum of all the data in this integer array.

Public? int? get(int[]? num){

int? x? =? 0;

For what? (int? Me? =? 0; ? Me? & lt? Number length; ? i++)? {

x? +=? num[I];

}

Return? x;

}

//? Pass in an integer array and return the method of the largest value in this integer array.

Public? int? get 1(int[]? num){

int? x? =? num[0];

For what? (int? Me? =? 0; ? Me? & lt? Number length; ? i++)? {

x? =? Math.max(x,num[I]);

}

Return? x;

}

}