编写一个java应用程序,输出全部的希腊字母。
推荐于2018-03-23
展开全部
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("");
}
}
}
}
2013-11-27
展开全部
这个容易啊,你只需要知道希腊字母在ASCII编码中的起始和结束值,完了用个for循环直接打印字符就是了撒!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-11-27
展开全部
需要知道希腊字母的ASCII码,循环打印出来就行了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
来个更简单版的:
public class alphabet{
public static void main(String args[]){
int first = 'α';
int last = 'ω';
for(int i=first;i<=last;i++){
System.out.print(" "+(char)i);
}
}
}
public class alphabet{
public static void main(String args[]){
int first = 'α';
int last = 'ω';
for(int i=first;i<=last;i++){
System.out.print(" "+(char)i);
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
package lt;
public static void main(String args[])
{
char a='\u03b1';
for(int i=0;i<10;i++)
{
System.out.println("希腊字符"+a);
a++;
}
}
}
public static void main(String args[])
{
char a='\u03b1';
for(int i=0;i<10;i++)
{
System.out.println("希腊字符"+a);
a++;
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询