-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.cc
41 lines (33 loc) · 821 Bytes
/
main.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <cassert>
void PrintLines(std::vector<std::wstring> const& lines, int leftMargin)
{
auto const cnt = leftMargin;
for (auto const& line: lines)
{
static auto const totalLeftMargin = 2 * leftMargin;
assert(4 == totalLeftMargin);
for (int i = 0; i < totalLeftMargin; ++i)
std::wcout << "-";
std::wcout << line << std::endl;
}
}
int main(int argc, char const* argv[])
{
PrintLines(std::vector<std::wstring> {
L"First",
L"Second",
}, 2);
// ----First
// ----Second
PrintLines(std::vector<std::wstring> {
L"First",
L"Second",
}, 4);
// ----First
// ----Second
return EXIT_SUCCESS;
}