您的位置:首页 > 编程语言 > Java开发

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

2016-09-13 12:05 519 查看
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();
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: