实现打印1到100,遇到数字为3的倍数时打印“three”,5的倍数打印“five",既是3的倍数又是5的倍数打印”three_five“;
[code="java"]
public static void main(String[] args) {
for(int i=1; i< 101;i++){
if(i % 3 == 0 ){
if( i % 5 == 0 ){
System.out.println("three&five's mulriple");
continue;
}
System.out.println("three's mulriple");
continue;
}
if(i% 5 == 0){
System.out.println("five's mulriple");
continue;
}
System.out.println(i);
}
}
[/code]
有没有更好的算法或思路。