From e68a979794cd2a94f9c7a7006fee1e3913171713 Mon Sep 17 00:00:00 2001 From: z4root Date: Fri, 30 Oct 2026 22:31:21 +0000 Subject: [PATCH] feat(kata): remove the arr --- Katas/CP/team/src/solution.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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; }