1、if-else 语句没有写完整,缺少else if(x>3) { y=2*x+1; } 要加上else if(x>3) { y=2*x+1; } else y=2*x; 2、没有初始化赋值,只是单纯定义了变量