7个回答
展开全部
代码如下:
package 输出全部希腊字母;
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 printGreek()
{
int firstLetter, lastLetter;
char firstG = 'α', lastG = 'ω'; //获取首字母与末字母的值
firstLetter = (int)firstG;
lastLetter = (int)lastG;
System.out.println("希腊字母表: ");
for(int i = firstLetter; i <= lastLetter; ++i)
{
char greekLetter;
greekLetter = (char)i;
System.out.print(" "+greekLetter);
}
System.out.println();
}
参考地址:http://blog.csdn.net/qdliuzhen/article/details/8057705
{
int firstLetter, lastLetter;
char firstG = 'α', lastG = 'ω'; //获取首字母与末字母的值
firstLetter = (int)firstG;
lastLetter = (int)lastG;
System.out.println("希腊字母表: ");
for(int i = firstLetter; i <= lastLetter; ++i)
{
char greekLetter;
greekLetter = (char)i;
System.out.print(" "+greekLetter);
}
System.out.println();
}
参考地址:http://blog.csdn.net/qdliuzhen/article/details/8057705
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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("");
}
}
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
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("");
}
}
}
}
参考资料: http://zhidao.baidu.com/question/35307828.html?fr=ala0
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询