题解 | #下厨房#

下厨房

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 广东

相关推荐

12-20 11:26
复旦大学 Java
点赞 评论 收藏
分享
11-07 16:07
深圳大学 运营
前端飞升:学长,阿里不是卡双非吗,我深也能去吗
点赞 评论 收藏
分享
活泼的代码渣渣在泡池...:哈哈哈挺好的,我也上岸美团了,不说了,我又接了一单
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务