标签:print hang rgs max -- public class ++i char
class Demo13
{
public static void main(String[] args)
{
char[] arr = {‘a‘, ‘b‘, ‘c‘, ‘d‘, ‘e‘};
chang(arr);
}
public static void chang(char[] arr)
{
char temp;
int i;
int min = 0;
int max = arr.length - 1;
for(; min < max; ++min, --max)
{
temp = arr[min];
arr[min] = arr[max];
arr[max] = temp;
}
for(i = 0; i < arr.length; ++i)
{
System.out.print(arr[i] + ", ");
}
}
}
标签:print hang rgs max -- public class ++i char
原文地址:http://www.cnblogs.com/cpp-cpp/p/6293058.html