Skip to content
Snippets Groups Projects
Commit deb44c2b authored by Andrii Protas's avatar Andrii Protas
Browse files

sum fixed

parent d49edb41
No related branches found
No related tags found
No related merge requests found
Pipeline #40910 failed
......@@ -8,7 +8,9 @@ using namespace aria::csv;
int64_t ToInt(std::string_view s) {
int64_t result = 0;
for (auto c : s) result = result * 10 + (c - '0');
for (auto c : s)
if (c != '.')
result = result * 10 + (c - '0');
return result;
}
......@@ -19,9 +21,7 @@ int64_t sum_extendedprice(const std::string& file_name) {
int64_t price_sum = 0;
uint64_t field_number = 0;
for (auto row : lineitem) {
for (const auto& field : row) {
price_sum += ToInt(row[5]);
}
price_sum += ToInt(row[5]);
}
return price_sum;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment