Update some 2015 sources to .clang-tidy

This commit is contained in:
2021-12-02 19:57:58 +00:00
parent 7ab7ecb00a
commit 9ecc3ff53d
27 changed files with 305 additions and 336 deletions

View File

@@ -2,15 +2,16 @@
#include <iostream>
#include <string>
int main(int argc, char** argv)
auto main() -> int
{
for (std::string line; std::getline(std::cin, line);) {
int floor = 0;
std::string::size_type pos = 0;
for (auto c : line) {
for (auto c : line) { // NOLINT(readability-identifier-length)
++pos;
assert(c == '(' || c == ')');
floor += (c == '(') - (c == ')');
floor += (c == '(') ? 1 : 0;
floor -= (c == ')') ? 1 : 0;
if (floor == -1) {
break;
}