var x = 19000; var a =0; while(x>=2750){ x+=1400; x-=2750; a++; } console.log("可以还"+a+"个月房贷"); console.log("最后还剩"+x+"元");