Java第三章习题3-4(for循环输出俄文字母表)
2016-09-13 12:05
519 查看
Letter.java
Test.java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author Administrator */ public class Letter { public void print(){ char startLetter='а',endLetter='я'; int startPosition=startLetter,endPosition=endLetter; for(int i=startPosition;i<endPosition;i++){ char russiannumber=(char)i; System.out.print(" "+russiannumber); if((i-startPosition+1)%10==0){ System.out.println(""); } } } }
Test.java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author Administrator */ public class Test { public static void main(String[] args){ Letter le=new Letter(); le.print(); } }
相关文章推荐
- 第三章习题3第4题--for循环输出俄文字母表
- 【java】for循环输出数字金字塔
- Javafor循环输出菱形
- 【java】for循环输出数字金字塔
- for循环输出树木的形状【java】
- for循环输出漏斗的形状【java】
- Java中循环问题:for,while,do-while 各种练习(打印上三角、下三角、输出100以内的素数、水仙花、最大公约、最小公倍数、分解质因数、兔子问题)
- java基础--for循环输出"*"号三角形
- JAVA输出九九乘法表,用for,dowhile,while循环语句输出
- Java利用for循环输出空心菱形的实例代码
- 使用for循环经典案例输出空心的菱形 in Java
- 关于java一个for循环输出九九乘法表
- Java基础应用之循环控制(for循环输出空心的菱形)
- java利用for循环输出正三角新解
- for循环输出空心菱形的形状【java】
- JAVA用for循环输出1!,2!,3!,4!,5!以及它们的和。
- Java只用一套嵌套for循环输出菱形
- java经典练习题:for+if...else 循环输出金字塔,乘法口诀表,长方形等--初学者入
- java用一个for循环输出99乘法表
- 【程序29】 TestAdd3.java 题目:求一个3*3矩阵对角线元素之和 1.程序分析:利用双重for循环控制输入二维数组, //再将a[i][i]累加后输出。