Update some 2015 sources to .clang-tidy
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
#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;
|
||||
for (auto c : line) {
|
||||
for (auto c : line) { // NOLINT(readability-identifier-length)
|
||||
assert(c == '(' || c == ')');
|
||||
floor += (c == '(') - (c == ')');
|
||||
floor += (c == '(') ? 1 : 0;
|
||||
floor -= (c == ')') ? 1 : 0;
|
||||
}
|
||||
std::cout << floor << "\n";
|
||||
}
|
||||
|
Reference in New Issue
Block a user