怎么循环 a到z啊 = =

来源:百度知道 编辑:UC知道 时间:2024/06/18 05:03:03
就像1~26那样 - =

for(int i=1;i<=26;i++)

a到z呢

用 ASCII码 就可以了

public static void main(String[] args) {
int x=65;
for(int i=0;i<26;i++)
{
char y=(char)(65+i);
System.out.print(y+" ");
}

}

for(char count='a';count<='z';count++){
.......
}
a到z,对应数值65到90