62,615
社区成员
发帖
与我相关
我的任务
分享
package com.demo.test;
class ThreeRen{
public static void main(String[] args){
int i,j,g;
for(i='x';i<='z';i++){
for(j='x';j<='z';j++){
if(i!=j){
for(g='x';g<='z';g++){
if(i!='x' && g!='x' && g!='z'){
System.out.println ("a:"+(char)i+" b:"+(char)j+" c:"+(char)g);
}
}
}
}
}
}
}
public class Test {
public static void main(String[] args) {
int line = 7;
line = line % 2 == 0 ? line + 1 : line;
for(int m = line / 2, i = -m; i <= m; i++) {
for(int j = -m, n = m - Math.abs(i); j <= n; j++) {
System.out.print(Math.abs(i) + Math.abs(j) > m ? ' ' : '*');
}
System.out.println();
}
}
}
*
***
*****
*******
*****
***
*