问题描述
解决方案
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
static String[] sz = { "a", "b", "c", "d", "e", "f" /* ... */ };
static void showTable(int n)
{
for (int i = 1; i <= n; i++)
{
for (int j = 0; j <= n - i; j++)
{
System.out.print(" ");
}
for (int j = i - 1; j >= 0; j--)
{
System.out.print(sz[j]);
}
System.out.println();
}
}
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
showTable(5);
}
}
解决方案二:
String s = "abcde";
String s1 = "";
for (int i = s.lengh() - 1; i >= 0; i--)
s1 += s.charAt(i);
System.out.println(s1);
解决方案三:
13周(数组倒序输出)
数组倒序输出
java iterator如何倒序输出
解决方案四:
for (char M = 'Z'; M >= 'A'; M--) {
System.out.print(M);
}
解决方案五:
for (char M = 'z'; M >= 'a'; M--) {
System.out.print(M);
}
解决方案六:
把打印的内容变为
a
ba
cba
dcba
edcba
.………………
这样的。
解决方案七:
http://ideone.com/J9LhfP
在线输出结果
时间: 2024-10-02 04:59:55