- public class T {
- public static void main(String[] args) {
- StringBuffer sbf = new StringBuffer();
- sbf.append("abcdefghick123456");
- System.out.println(sbf.reverse().toString());
- }
-
}//字符串的倒序输出
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- public class T {
- public void order() throws IOException {
- InputStreamReader is = new InputStreamReader(System.in);
- BufferedReader br = new BufferedReader(is);
- String str = br.readLine();
- char c[] = str.toCharArray();
- int i = str.length();
- i--;
- char temp;
- for (int j = 0; j < i; j++, i--) {
- temp = c[j];
- c[j] = c[i];
- c[i] = temp;
- }
- System.out.println(new String(c, 0, str.length()));
- }
- public static void main(String[] args) throws IOException {
- new T().order();
- }
- }//输入的倒序输出
- public class T {
- public static void main(String[] args) {
- int[] array = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
- for (int i = array.length - 1; i >= 0; i--) {
- System.out.print(i);
- }
- }
- }//字符串的倒序输出