站点图标 度崩网-几度崩溃

当输入为2的时候返回值是

	public static int cal(int i) {
		int result = 0;
		switch (i) {
		case 1:
			result = result + i;
		case 2:
			result = result + i * 2;
		case 3:
			result = result + i * 3;
		}
		return result;
	}

 


参考答案

case 语句缺少 break;

返回值是 10