public class Choose {
//交换位置
public void ExchangValue(int[] value) {
int tmpValue = value[0];
value[0] = value[1];
value[1] = tmpValue;
}
//求最值
public int MaxValue(int[] value) {
int result = value[0];
for (int i = 1; i < value.length; i++) {
if (value[i] > result) {
result = value[i];
}
}
return result;
}
//选择排序
public static void sortArray(int[] Array)
{
}
if(j!=1) //如果j==i代表元素本来就在正确的位置
Array[j]=element;
}
}
//递归求n!
public static int recursive(int i)
{
int sum = 0;
if (0 == i)
return (1);
else
sum = i * recursive(i-1);
return sum;
}
public static void testMaxvalue()
{
int [] testData=new int[]{1,50,200000,2,4,60,7,8,9,-2,};
Choose tools=new Choose();
int result=tools.MaxValue(testData);
System.out.println("test"+result);//, args)
}
//
public static void main(String[] arge) {
testMaxvalue();
System.out.println("<---------------------------------------->");
int [] Array=new int[]{1,50,20,2,4,60,7,8,9,-2,};
sortArray(Array);
System.out.println("<---------------------------------------->");
System.out.println(recursive(4));
System.out.println("<---------------------------------------->");
BubbleArray(Array);
System.out.println("<---------------------------------------->");