class test{
public static void main(String [] agrs){
char[][] ch = new char[5][10];
char c='1';
for(int i=0; i< ch.length; ++i){
for(int j=0;j<ch[i].length; ++j){
if(j%2==1) ch[i][j] = '@';
else{
if(i==0){
ch[i][j] = c++;
}
else ch[i][j] = (char)(ch[i-1][j] + 1);
}}}
for(int i=0; i< ch.length; ++i){
for(int j=0;j<ch[i].length; ++j){
System.out.print(ch[i][j]);
}
System.out.println();
}}}
你试试看行不行,不懂的你在问我
温馨提示:答案为网友推荐,仅供参考