library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub matumoto1234/library

:warning: string/join.hpp

Depends on

Code

#pragma once

#include "./base.hpp"

#include <string>
#include <vector>

namespace matumoto {
  string join(const vector<string> &strs, const string &sep) {
    string res = "";
    for (int i = 0; i < static_cast<int>(strs.size()); i++) {
      if (i)
        res += sep;
      res += strs[i];
    }
    return res;
  }
} // namespace matumoto
#line 2 "string/join.hpp"

#line 2 "string/base.hpp"

namespace matumoto {
  using namespace std;
}
#line 4 "string/join.hpp"

#include <string>
#include <vector>

namespace matumoto {
  string join(const vector<string> &strs, const string &sep) {
    string res = "";
    for (int i = 0; i < static_cast<int>(strs.size()); i++) {
      if (i)
        res += sep;
      res += strs[i];
    }
    return res;
  }
} // namespace matumoto
Back to top page