Skip to content

2015年03月09日 蛋炒饭 #43

@think2011

Description

@think2011

你是一家快餐店的老板,每天营业前,你需要根据采购的食材来确定今天能够做多少份快餐:

// 炒蛋饭食谱
var fryRice = {
    rice: 1,
    egg: 1,
    meat: 2
}

// 食材
var material = {
    rice: 10,     // 100
    egg: 10,     // 100
    meat: 5     // 50
}

function check (food, material) {
    // 请完成这个代码
}

console.log(check(fryRice, material)); 
// 结果: {sum: 2, remnants: {rice: 8, egg: 8, meat: 1}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions