char ccc= 97;//这里的97是字母的java的askII编码形式,a的编码是95,A是65;
//num 用与接受用户输入的,具体怎么样接受,根据具体情况;
for(i=0;i
int p=index/2+1;
int q=0;
for(int k=0;k
q=1;
}
if(q==0){
p--;
print(ccc);
}
if(q==1){
p++;
print(ccc);
}
}
}
对不起,先没有读懂题意...
import java.util.Scanner;
class Graph{
public static void main(String[] args){
Scanner s=new Scanner(System.in);
System.out.print("请输入要显示的行数:");
int m=s.nextInt();
StringBuilder sb=new StringBuilder(),sb2=new StringBuilder();
for(int j=0;j
}
sb2=new StringBuilder(sb);
sb.deleteCharAt(0);
sb.reverse();
sb.append(sb2);
System.out.println(sb);
sb=new StringBuilder();
}
}
}
import java.util.Scanner;
class Graph{
public static void main(String[] args){
Scanner s=new Scanner(System.in);
int m=s.nextInt();
StringBuilder sb=new StringBuilder();
for(char i='A';i
}
StringBuilder sb2=new StringBuilder(sb);
sb.deleteCharAt(0);
sb.reverse();
sb.append(sb2);
System.out.println(sb);
}
}