java写个遍历aaa-zzz反过来的字符串
时间: 2024-05-02 18:19:23 浏览: 170
以下是Java代码实现:
```
public class ReverseLetters {
public static void main(String[] args) {
for (char i = 'z'; i >= 'a'; i--) {
for (char j = 'z'; j >= 'a'; j--) {
for (char k = 'z'; k >= 'a'; k--) {
System.out.print(i);
System.out.print(j);
System.out.print(k);
System.out.print(" ");
}
}
}
}
}
```
输出结果:
```
zzz zzy zzx zzw zzv zz ... aaa
```
阅读全文