diff --git a/Katas/CP/team/src/solution.cpp b/Katas/CP/team/src/solution.cpp index 8597760..7aafb8e 100644 --- a/Katas/CP/team/src/solution.cpp +++ b/Katas/CP/team/src/solution.cpp @@ -14,16 +14,17 @@ int getKnowingProblems(int *problems, int n) { int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(NULL); - int n; + int n, num; + int total = 0; + std::string p; std::cin >> n; - std::string problem; int problems[n]; + std::cin.ignore(); - int total = 0; - int num; + for (int i = 0; i < n; i++) { - getline(std::cin, problem); - std::stringstream ss(problem); + getline(std::cin, p); + std::stringstream ss(p); while (ss >> num) { total += num; }