5-4作业
来源:5-10 编程练习
挪威_
2017-07-02 23:52:02
var year=parseInt(prompt("请输入员工入职年份"));
var mouth=parseInt(prompt("请输入员工入职月份"));
var date=parseInt(prompt("请输入员工入职时间"));
function st() {
var today=new Date();
today.setFullYear(year);
today.setMonth(mouth-1);
today.setDate(date);
var df=new Date(year+3,mouth-1,date);
document.write("该员工入职日期是"+year+"-"+mouth+"月"+"-"+date+"日"+"<br/>");
document.write("该员工合同到期日期是"+df.getFullYear()+"-"+(df.getMonth()+1)+"月"+"-"+df.getDate()+"日");
}
st(year,mouth,date);
1回答
好帮手慕糖
2017-07-03
你好,结果输出正确,棒棒的,继续加油!祝学习愉快~