C++ STL容器操作:6种常用场景算法

C++ STL容器操作:6种常用场景算法

[TOC]

引言

  在日常软件开发工作中,容器操作如查找、排序、和元素替换等任务极为常见。幸运的是,C++的标准化利器——STL(Standard Template Library,标准模板库)为我们封装了一系列高效且灵活的算法,极大简化了这些操作。特别是自C++11版本以来,STL引入了一批新晋的通用算法,它们不仅功能强大,而且设计得更加人性化,旨在进一步提升我们的编码效率与程序性能。本文列举一些常用到的方法,便于日后回顾和查阅。

概述

  日常开发中的容器操作,如查找、删除、排序、分割、拷贝和合并,均可借助STL中的精选算法高效完成。本文将概览这些核心STL算法,助力开发流程优化。

查找与计数

std::find

  • 作用: 找容器中第一个匹配给定值的元素
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    DumpVector("testArrgs", testArrgs);

    auto find = std::find(testArrgs.begin(), testArrgs.end(), "XiaoMing");
    if (find != testArrgs.end()) {
        SPR_LOGD("find: dest = \"XiaoMing\", result = %s, index = %ld\n", find->c_str(), find - testArrgs.begin());
    }
  • 结果
D: find: dest = "XiaoMing", result = XiaoMing, index = 2

std::find_if

  • 作用: 查找容器中第一个满足谓词条件的元素
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    
    auto findIf = std::find_if(testArrgs.begin(), testArrgs.end(),  [](const std::string &str) { return str.find("Ming") != std::string::npos; });
    if (findIf != testArrgs.end()) {
        SPR_LOGD("find_if: dest = \"Ming\", result = %s, index = %ld\n", findIf->c_str(), findIf - testArrgs.begin());
    }

③ 结果

D: find_if: dest = "Ming", result = XiaoMing, index = 2

std::find_if_not

  • 作用: 寻找第一个不符合指定条件的元素
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};

    auto findIfNot = std::find_if_not(testArrgs.begin(), testArrgs.end(),  [](const std::string &str) { return str.find("Xiao") != std::string::npos; });
    if (findIfNot != testArrgs.end()) {
        SPR_LOGD("find_if_not: dest = \"Xiao\", result = %s, index = %ld\n", findIfNot->c_str(), findIfNot - testArrgs.begin());
    }
  • 结果
D: find_if_not: dest = "Xiao", result = LiHua, index = 1

std::find_end

  • 作用: 查找一个子序列最后一次出现的位置
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};

    vector<std::string> subArrgs1 = {"XiaoMing", "XiaoHong"};
    auto findEnd = std::find_end(testArrgs.begin(), testArrgs.end(), subArrgs1.begin(), subArrgs1.end());
    if (findEnd != testArrgs.end()) {
        SPR_LOGD("find_end: dest = {\"XiaoMing\", \"XiaoHong\"}, result = %s, index = %ld\n", findEnd->c_str(), findEnd - testArrgs.begin());
    }
  • 结果
D: find_end: dest = {"XiaoMing", "XiaoHong"}, result = XiaoMing, index = 3

std::find_first_of

  • 作用: 查找序列中任何一个元素首次出现的位置
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};

    vector<std::string> subArrgs2 = {"JianGuo"};
    auto findFirstOf = std::find_first_of(testArrgs.begin(), testArrgs.end(), subArrgs2.begin(), subArrgs2.end());
    if (findFirstOf != testArrgs.end()) {
        SPR_LOGD("find_first_of: dest = {\"JianGuo\"}, result = %s, index = %ld\n", findFirstOf->c_str(), findFirstOf - testArrgs.begin());
    }
  • 结果
D: find_first_of: dest = {"JianGuo"}, result = JianGuo, index = 5

std::adjacent_find

  • 作用: 查找相邻重复的元素
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};

    auto adjacentFind = std::adjacent_find(testArrgs.begin(), testArrgs.end(), [](const std::string &str1, const std::string &str2) { return str1 == str2; });
    if (adjacentFind != testArrgs.end()) {
        SPR_LOGD("adjacent_find: result = %s, index = %ld\n", adjacentFind->c_str(), adjacentFind - testArrgs.begin());
    }
  • 结果
D: adjacent_find: result = XiaoMing, index = 2

std::count

  • 作用: 计算容器中指定值出现的次数
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};

    auto cnt = std::count(testArrgs.begin(), testArrgs.end(), "XiaoFang");
    if (cnt > 0) {
        SPR_LOGD("count: dest = \"XiaoFang\", result = %ld\n", cnt);
    }
  • 结果
D: count: dest = "XiaoFang", result = 1

std::count_if

  • 作用: 计算满足谓词条件的元素数量
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    
    auto cntIf = std::count_if(testArrgs.begin(), testArrgs.end(), [](const std::string &str) { return str.find("Xiao") != std::string::npos; });
    if (cntIf > 0) {
        SPR_LOGD("count_if: dest = \"Xiao\", result = %ld\n", cntIf);
    }
  • 结果
D: count_if: dest = "Xiao", result = 6

移除与替换

std::remove

  • 作用: 重新排列容器元素,使得所有不匹配特定值的元素被放置在容器的前端。配合earse实现移除不匹配元素。
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};

    vector<std::string> rmArrgs(testArrgs);
    auto remove = std::remove(rmArrgs.begin(), rmArrgs.end(), "XiaoMing");
    if (remove != rmArrgs.end()) {
        rmArrgs.erase(remove, rmArrgs.end());
        DumpVector("rmArrgs", rmArrgs);
    }
  • 结果
D: rmArrgs: "XiaoFang", "LiHua", "XiaoHong", "JianGuo", "XiaoFangFang",

std::remove_if

  • 作用: 重新排列容器元素,使得所有不满足谓词条件的元素被放置在容器的前端。配合earse实现移除不匹配元素。
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    
    vector<std::string> rmIfArrgs(testArrgs);
    auto removeIf = std::remove_if(rmIfArrgs.begin(), rmIfArrgs.end(), [](const std::string &str) { return str.find("Xiao") != std::string::npos; });
    if (removeIf != rmIfArrgs.end()) {
        rmIfArrgs.erase(removeIf, rmIfArrgs.end());
        DumpVector("rmArrgs", rmArrgs);
    }
  • 结果
D: rmIfArrgs: "XiaoFang", "LiHua", "XiaoHong", "JianGuo", "XiaoFangFang"

std::remove_copy

  • 作用: 从源序列拷贝元素到目标序列,排除满足条件的元素。
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    
    vector<std::string> dstArrgs;
    vector<std::string> rcArrgs(testArrgs);
    std::remove_copy(rcArrgs.begin(), rcArrgs.end(), std::back_inserter(dstArrgs), "XiaoMing");
    DumpVector("dstArrgs", dstArrgs);
  • 结果
D: dstArrgs: "XiaoFang", "LiHua", "XiaoHong", "JianGuo", "XiaoFangFang"

std::replace

  • 作用: 将所有出现的指定元素替换为新值。
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    
    vector<std::string> rpArrgs(testArrgs);
    std::replace(rpArrgs.begin(), rpArrgs.end(), "XiaoMing", "MingMing");
    DumpVector("rpArrgs", rpArrgs);
  • 结果
D: rpArrgs: "XiaoFang", "LiHua", "MingMing", "MingMing", "XiaoHong", "JianGuo", "XiaoFangFang", "MingMing",

std::replace_if

  • 作用: 满足谓词条件的元素,替换为指定的替换值。
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    
    vector<std::string> rpIfArrgs(testArrgs);
    std::replace_if(rpIfArrgs.begin(), rpIfArrgs.end(), [](const std::string &str) { return (str == "XiaoFang"); }, "FangFang");
    DumpVector("rpIfArrgs", rpIfArrgs);
  • 结果
 D: rpIfArrgs: "FangFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing",

std::replace_copy

  • 作用:用于在指定范围内将所有匹配某个值的元素替换为另一个值,拷贝到另一个的容器中。
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    
    vector<std::string> rpCpDstArrgs;
    vector<std::string> rpCopyArrgs(testArrgs);
    std::replace_copy(rpCopyArrgs.begin(), rpCopyArrgs.end(), std::back_inserter(rpCpDstArrgs), "XiaoMing", "MingMing");
    DumpVector("rpCpDstArrgs", rpCpDstArrgs);
  • 结果
D: rpCpDstArrgs: "XiaoFang", "LiHua", "MingMing", "MingMing", "XiaoHong", "JianGuo", "XiaoFangFang", "MingMing"

std::swap

  • 作用:交换两个变量的值。
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};
    
    vector<std::string> swapSrcArrgs(testArrgs);
    vector<std::string> swapDstArrgs = {"Vince Carter", "Rose", "James"};
    std::swap(swapSrcArrgs, swapDstArrgs);
    DumpVector("swapSrcArrgs", swapSrcArrgs);
    DumpVector("swapDstArrgs", swapDstArrgs);
  • 结果
  D: swapSrcArrgs: "Vince Carter", "Rose", "James", 
  D: swapDstArrgs: "XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing", 

排序与组织

std::sort

  • 作用:对容器元素进行排序。
  • 示例
    vector<std::string> testArrgs = {"XiaoFang", "LiHua", "XiaoMing", "XiaoMing", "XiaoHong", "JianGuo", "XiaoFangFang", "XiaoMing"};

    // sort
    vector<std::string> sortArrgs(testArrgs);
    std::sort(sortArrgs.begin(), sortArrgs.end());
    DumpVector("sortArrgs", sortArrgs);
    std::sort(sortArrgs.begin(), sortArrgs.end(), [](const std::string &str1, const std::string &str2) { return str1.size() > str2.size(); });
    DumpVector("sortArrgs", sortArrgs);

  • 结果
  D: sortArrgs: "JianGuo", "LiHua", "XiaoFang", "XiaoFangFang", "XiaoHong", "XiaoMing", "XiaoMing", "XiaoMing", 
  D: sortArrgs: "XiaoFangFang", "XiaoFang", "XiaoHong", "XiaoMing", "XiaoMing", "XiaoMing", "JianGuo", "LiHua", 

std::stable_sort

  • 作用:稳定排序,保持相等元素的原有顺序。
  • 示例
    // stable_sort
    vector<Persion> srcPersions = {{"LiWei", 18}, {"LiHua", 20}, {"ZhangLei", 19}, {"WeiGuo", 19}, {"ZhenHua", 20}, {"JianGuo", 18}, {"ZhiGuo", 19}, {"JianHua", 19}};
    vector<Persion> sPersions(srcPersions);
    std::stable_sort(sPersions.begin(), sPersions.end(), [](const Persion &p1, const Persion &p2) { return p1.age > p2.age; });
    DumpVector("sPersions", sPersions);
    std::stable_sort(sPersions.begin(), sPersions.end(), [](const Persion &p1, const Persion &p2) { return p1.age < p2.age; });
    DumpVector("sPersions", sPersions);
  • 结果
  D: sPersions = { {"LiHua", 20}, {"ZhenHua", 20}, {"ZhangLei", 19}, {"WeiGuo", 19}, {"ZhiGuo", 19}, {"JianHua", 19}, {"LiWei", 18}, {"JianGuo", 18}, }
  D: sPersions = { {"LiWei", 18}, {"JianGuo", 18}, {"ZhangLei", 19}, {"WeiGuo", 19}, {"ZhiGuo", 19}, {"JianHua", 19}, {"LiHua", 20}, {"ZhenHua", 20}, }

std::partial_sort

  • 作用:对部分区间排序。
  • 示例
    vector<Persion> srcPersions = {{"LiWei", 18}, {"LiHua", 20}, {"ZhangLei", 19}, {"WeiGuo", 19}, {"ZhenHua", 20}, {"JianGuo", 18}, {"ZhiGuo", 19}, {"JianHua", 19}};

    // partial_sort
    vector<Persion> prtPersions(srcPersions);
    vector<Persion> sortPersions(srcPersions);
    std::partial_sort(prtPersions.begin(), prtPersions.begin() + 5, prtPersions.end(), [](const Persion &p1, const Persion &p2) { return p1.age > p2.age; });
    std::sort(sortPersions.begin(), sortPersions.begin() + 5, [](const Persion &p1, const Persion &p2) { return p1.age > p2.age; });
    DumpVector("prtPersions", prtPersions);
    DumpVector("sortPersions", sortPersions);
  • 结果
  D: prtPersions = { {"ZhenHua", 20}, {"LiHua", 20}, {"WeiGuo", 19}, {"ZhiGuo", 19}, {"ZhangLei", 19}, {"JianGuo", 18}, {"LiWei", 18}, {"JianHua", 19}, }
  D: sortPersions = { {"LiHua", 20}, {"ZhenHua", 20}, {"ZhangLei", 19}, {"WeiGuo", 19}, {"LiWei", 18}, {"JianGuo", 18}, {"ZhiGuo", 19}, {"JianHua", 19}, }

std::reverse

  • 作用:对部分区间排序。
  • 示例
    vector<Persion> srcPersions = {{"LiWei", 18}, {"LiHua", 20}, {"ZhangLei", 19}, {"WeiGuo", 19}, {"ZhenHua", 20}, {"JianGuo", 18}, {"ZhiGuo", 19}, {"JianHua", 19}};

    // reverse
    vector<Persion> rPersions(srcPersions);
    std::reverse(rPersions.begin(), rPersions.end());
    DumpVector("rPersions", rPersions);
  • 结果
  D: rPersions = { {"JianHua", 19}, {"ZhiGuo", 19}, {"JianGuo", 18}, {"ZhenHua", 20}, {"WeiGuo", 19}, {"ZhangLei", 19}, {"LiHua", 20}, {"LiWei", 18}, }

std::rotate

  • 作用:对部分区间排序。
  • 示例
    vector<Persion> srcPersions = {{"LiWei", 18}, {"LiHua", 20}, {"ZhangLei", 19}, {"WeiGuo", 19}, {"ZhenHua", 20}, {"JianGuo", 18}, {"ZhiGuo", 19}, {"JianHua", 19}};

    // rotate
    vector<Persion> rtPersions(srcPersions);
    std::rotate(rtPersions.begin(), rtPersions.begin() + 3, rtPersions.end());
    DumpVector("rtPersions", rtPersions);
  • 结果
  D: rPersions = { {"JianHua", 19}, {"ZhiGuo", 19}, {"JianGuo", 18}, {"ZhenHua", 20}, {"WeiGuo", 19}, {"ZhangLei", 19}, {"LiHua", 20}, {"LiWei", 18}, }

分割

std::partition

  • 作用:分割容器,使满足谓词的元素在前,不满足的在后。
  • 示例
    vector<std::string> testArrgs = {"LiHua", "ZhangHong", "HeDa", "LiWei", "ZhangLei", "WeiGuo", "ZhenHua"};

    // partition
    vector<std::string> partArrgs(testArrgs);
    std::partition(partArrgs.begin(), partArrgs.end(), [](const std::string& str) { return (str.compare(0, 5, "Zhang") == 0); });
    DumpVector("partArrgs", partArrgs);
  • 结果
  D: partArrgs: "ZhangLei", "ZhangHong", "HeDa", "LiWei", "LiHua", "WeiGuo", "ZhenHua",

std::stable_partition

  • 作用:类似partition,但保持相同元素的相对顺序不变。
  • 示例
    vector<std::string> testArrgs = {"LiHua", "ZhangHong", "HeDa", "LiWei", "ZhangLei", "WeiGuo", "ZhenHua"};

    // stable_partition
    vector<std::string> stPartArrgs(testArrgs);
    std::stable_partition(stPartArrgs.begin(), stPartArrgs.end(), [](const std::string& str) { return (str.compare(0, 5, "Zhang") == 0); });
    DumpVector("stPartArrgs", stPartArrgs);
  • 结果
  D: stPartArrgs: "ZhangHong", "ZhangLei", "LiHua", "HeDa", "LiWei", "WeiGuo", "ZhenHua", 

拷贝与生成

std::copy

  • 作用:拷贝容器或范围内的元素到另一位置。
  • 示例
    vector<std::string> srcArrgs = {"LiHua", "ZhangHong", "HeDa", "LiWei", "ZhangLei", "WeiGuo", "ZhenHua"};

    // copy
    vector<std::string> dstCopyArrgs;
    std::copy(srcArrgs.begin(), srcArrgs.end(), std::back_inserter(dstCopyArrgs));
    DumpVector("dstCopyArrgs", dstCopyArrgs);
  • 结果
  D: dstCopyArrgs: "LiHua", "ZhangHong", "HeDa", "LiWei", "ZhangLei", "WeiGuo", "ZhenHua",

std::copy_if

  • 作用:根据谓词条件拷贝元素。
  • 示例
    vector<std::string> srcArrgs = {"LiHua", "ZhangHong", "HeDa", "LiWei", "ZhangLei", "WeiGuo", "ZhenHua"};

    // copy_if
    vector<std::string> dstCopyIfArrgs;
    std::copy_if(srcArrgs.begin(), srcArrgs.end(), std::back_inserter(dstCopyIfArrgs), [](const std::string& str) { return (str.compare(0, 5, "Zhang") == 0); });
    DumpVector("dstCopyIfArrgs", dstCopyIfArrgs);
  • 结果
  D: dstCopyIfArrgs: "ZhangHong", "ZhangLei", 

std::copy_n

  • 作用:拷贝指定数量的元素。
  • 示例
    vector<std::string> srcArrgs = {"LiHua", "ZhangHong", "HeDa", "LiWei", "ZhangLei", "WeiGuo", "ZhenHua"};

    // copy_n
    vector<std::string> dstCopyNArrgs;
    std::copy_n(srcArrgs.begin(), 3, std::back_inserter(dstCopyNArrgs));
    DumpVector("dstCopyNArrgs", dstCopyNArrgs);
  • 结果
  D: dstCopyNArrgs: "LiHua", "ZhangHong", "HeDa",

std::generate

  • 作用:使用生成器函数填充容器。
  • 示例
    // generate
    vector<std::string> genArrgs(5);
    std::generate(genArrgs.begin(), genArrgs.end(), [](){ return "Hello"; });
    DumpVector("genArrgs", genArrgs);
  • 结果
  D: genArrgs: "Hello", "Hello", "Hello", "Hello", "Hello", 

std::generate_n

  • 作用:生成指定数量的元素填充容器。
  • 示例
    // generate_n
    vector<std::string> genNArrgs;
    std::generate_n(std::back_inserter(genNArrgs), 3, [](){ return "Hello"; });
    DumpVector("genNArrgs", genNArrgs);
  • 结果
  D: genNArrgs: "Hello", "Hello", "Hello", 

集合操作

std::merge

  • 作用:生成指定数量的元素填充容器。
  • 示例
    vector<std::string> srcArrgs = {"Vince Carter", "Rose", "James"};

    // merge
    vector<std::string> mergeArrgs;
    vector<std::string> tmpArrgs = {"Irving"};
    std::merge(srcArrgs.begin(), srcArrgs.end(), tmpArrgs.begin(), tmpArrgs.end(), std::back_inserter(mergeArrgs));
    DumpVector("mergeArrgs", mergeArrgs);
  • 结果
  D: mergeArrgs: "Irving", "Vince Carter", "Rose", "James", 

std::inplace_merge

  • 作用:就地归并两个有序范围。
  • 示例
    vector<std::string> srcArrgs = {"Vince Carter", "Rose", "James"};

    // inplace_merge
    vector<std::string> inplaceMergeArrgs(srcArrgs);
    std::inplace_merge(inplaceMergeArrgs.begin(), inplaceMergeArrgs.begin() + 2, inplaceMergeArrgs.end());
    DumpVector("inplaceMergeArrgs", inplaceMergeArrgs);
  • 结果
  D: inplaceMergeArrgs: "James", "Vince Carter", "Rose",
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,324评论 5 476
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,303评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,192评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,555评论 1 273
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,569评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,566评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,927评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,583评论 0 257
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,827评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,590评论 2 320
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,669评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,365评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,941评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,928评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,159评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 42,880评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,399评论 2 342

推荐阅读更多精彩内容