题解 | #下厨房#

下厨房

https://www.nowcoder.com/practice/ca5c9ba9ebac4fd5ae9ba46114b0f476

#include <iostream>
using namespace std;
#include "string"
#include <map>
int main() {
    string foodItem;
    map<string, string> item; 

    while (cin >> foodItem) { // 注意 while 处理多个 case     
        item[foodItem] = foodItem;
    }
    cout<<item.size();
}
// 64 位输出请用 printf("%lld")

全部评论
map不是我这样用的吧哈哈哈,主打一个不重复集合
点赞 回复 分享
发布于 2023-12-22 11:50 广东

相关推荐

我就是0offer糕手:北大不乱杀
点赞 评论 收藏
分享
04-25 10:45
东南大学 Java
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务