编写一个Java应用程序,输出全部的希腊字母
2个回答
展开全部
public class GreekAlphabet {
public static void main(String args[]) {
int startPosition = 0, endPosition = 0;
char cSrart = 'α', cEnd = 'ω';
startPosition = (int) cSrart;
endPosition = (int) cEnd;
System.out.println("希腊字母表:");
System.out.println("小写:");
for (int i = startPosition; i <= endPosition; i++) {
char c = '\0';
c = (char) i;
System.out.print(" " + c);
if ((i - startPosition + 1) % 10 == 0) {
System.out.println("");
}
}
System.out.println();
cSrart = 'Α';
cEnd = 'Ω';
startPosition = (int) cSrart;
endPosition = (int) cEnd;
System.out.println("大写:");
for (int i = startPosition; i <= endPosition; i++) {
char c = '\0';
c = (char) i;
System.out.print(" " + c);
if ((i - startPosition + 1) % 10 == 0) {
System.out.println("");
}
}
}
}
public static void main(String args[]) {
int startPosition = 0, endPosition = 0;
char cSrart = 'α', cEnd = 'ω';
startPosition = (int) cSrart;
endPosition = (int) cEnd;
System.out.println("希腊字母表:");
System.out.println("小写:");
for (int i = startPosition; i <= endPosition; i++) {
char c = '\0';
c = (char) i;
System.out.print(" " + c);
if ((i - startPosition + 1) % 10 == 0) {
System.out.println("");
}
}
System.out.println();
cSrart = 'Α';
cEnd = 'Ω';
startPosition = (int) cSrart;
endPosition = (int) cEnd;
System.out.println("大写:");
for (int i = startPosition; i <= endPosition; i++) {
char c = '\0';
c = (char) i;
System.out.print(" " + c);
if ((i - startPosition + 1) % 10 == 0) {
System.out.println("");
}
}
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |