### Win counter and enlist the winners every game

Hello, I tried to make game where you can determine the winner by inputting their scores
i'm just confuse how to count the wins of one team
also im confuse how to enlist the winners in 3 games as indicated inside the for loop, those slashes are my trial and error but no luck.

here's my code:
 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455`` ``````#include #include using namespace std; main(){ int p1, p2, a=4; int wincount=0; string team1, team2; for (int j=0; j> team1; cout << "Input Team 2 name: "; cin >> team2; for (int v=1; v<=3; v++) { cout << "Round " << v << ": " << endl; cout << "\tTeam " << team1 << " Points: "; cin >> p1; cout << "\tTeam " << team2 << " Points: "; cin >> p2; cout << "================================\n"; if (p1 > p2) { cout << "Winner: Team " << team1 << endl; wincount += 1; } else if (p1 < p2) { cout << "Winner: Team " << team2 << endl; wincount += 1; } else { cout << "No winner\n"; } } cout << "Team " << team1 << ": " << wincount << "wins(s)" << endl; cout << "Team " << team2 << ": " << wincount << "wins(s)" << endl; cout << "Game " << j+1 << "Winner: "; } //cout << "Summary of winners: "; //for (int i=1; i

expected output for the first part
 ``` GAME 1 Input Team 1 name: 22 Input Team 2 name: Lols Round 1: Team 22 Points: 20 Team Lols Points: 20 ______________________________ NO WINNER! Round 2: Team 22 Points: 19 Team Lols Points: 20 ______________________________ Winner: Team Lols Round 3: Team 22 Points: 25 Team Lols Points: 30 ______________________________ Winner: Team Lols Team 22: 0 WIN(S) Team Lols: 2 WIN(S) GAME 2 WINNER: Team Lols ```

Expected output for winner last at the last part
 ```SUMMARY OF WINNERS: Game 1: Team1 Game 2: Team34 Game 3: Team Lols Game 4: Team 45```

any help is appreciated
PS: I don't use, void, public, class, struggle,bool or anything advance c++ topics
Last edited on
Consider:

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960`` ``````#include #include int main() { constexpr size_t NoGames {4}; constexpr size_t NoRnd {3}; std::string winners[NoGames]; for (size_t j {}; j < NoGames; ++j) { std::string team1, team2; int p1 {}, p2 {}; size_t t1cnt {}, t2cnt {}; std::cout << "\nGAME " << j + 1 << '\n'; std::cout << "Input Team 1 name: "; std::cin >> team1; std::cout << "Input Team 2 name: "; std::cin >> team2; for (size_t v {1}; v <= NoRnd; ++v) { std::cout << "Round " << v << ":\n"; std::cout << "\tTeam " << team1 << " Points: "; std::cin >> p1; std::cout << "\tTeam " << team2 << " Points: "; std::cin >> p2; std::cout << "================================\n"; if (p1 > p2) { std::cout << "Winner: Team " << team1 << '\n'; ++t1cnt; } else if (p1 < p2) { std::cout << "Winner: Team " << team2 << '\n'; ++t2cnt; } else std::cout << "No winner\n"; } std::cout << "Team " << team1 << ": " << t1cnt << " wins(s)\n"; std::cout << "Team " << team2 << ": " << t2cnt << " wins(s)\n"; std::cout << "\nGame " << j + 1; if (t1cnt > t2cnt) { std::cout << " Winner Team " << team1 << '\n'; winners[j] = team1; } else if (t2cnt > t1cnt) { std::cout << " Winner Team " << team2 << '\n'; winners[j] = team2; } else { std::cout << " Draw!\n"; winners[j] = "Draw"; } } std::cout << "\nSummary of winners\n"; for (size_t i {}; i < NoGames; ++i) std::cout << "Game " << i + 1 << ": " << winners[i] << '\n'; }``````

Oh my god! thank you very much may god bless you
Topic archived. No new replies allowed.