public static void main(String args[]){
boolean flag1 = true;
while(flag1){
Scanner as = new Scanner(System.in);
System.out.println("-----------------------------------------------------");
System.out.println("-------------------插值法求解近似值-------------------");
System.out.println("-------------------请选择插值方法---------------------");
System.out.println("--------------------1、拉格朗日-----------------------");
System.out.println("--------------------2、牛顿插值-----------------------");
System.out.println("--------------------退出请按0-------------------------");
System.out.println("-----------------------------------------------------");
flag=as.nextInt();
if(flag == 0) {
flag1=false;
System.out.println("您已退出程序!欢迎下次使用。");
}
if(flag == 1){
int n = 1;
float x = 0;
System.out.println("请输入n:");
1