1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > Java第三章习题3-4(for循环输出俄文字母表)

Java第三章习题3-4(for循环输出俄文字母表)

时间:2019-09-09 22:13:43

相关推荐

Java第三章习题3-4(for循环输出俄文字母表)

Letter.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();}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。