1.
public class E{ public static void main(String[] args){ System.out.println("你"); System.out.println("我"); System.out.println("他"); } }
2.
public class G{ 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(""); } } } }
java课程学习二:编写程序
最新推荐文章于 2022-07-17 16:02:03 发布