如跳过1-10中的5求其它数的和,以下是我写的代码
public class hw8 {
public static void main(String[] args){
int i = 1;
int b = 0;
while(i<=10){
if(i==5){
System.out.println("break 5");
continue;
}
b+=i;
i++;
}
System.out.println("b="+b);
}
}
但是运行的时候无限重复输出break 5,想知道哪里出了问题,应该怎样用。