+ 1

Help with scoreboard please

in the part below i cant get team y to score and i cant get it to remember the total score of a team please help someone :). #include <iostream> using namespace std; int main (){ int x; int y; if (x){ cin>>x; x++; cout<< "Team x has scored"<<endl << " Team x now has - " << x << " points" <<endl; return x; } if (y){ cin>>y; y++; cout<< "Team y has scored"<<endl <<"Team y now has - "<< y<< " points"<<endl; return y; } }

11th Jan 2017, 4:06 AM
Jeroen Rikken
Jeroen Rikken - avatar
3 Antworten
+ 2
#include <iostream> using namespace std; int team_x( int ); int team_y (int ); int main (){ int x; cout<<"Enter the number"; cin>>x; team_x(x); cout<<"Enter the number"; int y; cin>>y; team_y(y); return 0; } int team_x ( int x){ x++; cout<< "Team x has scored"<<endl << " Team x now has - " << x << " points" <<endl; return x; } int team_y (int y){ y++; cout<< "Team y has scored"<<endl <<"Team y now has - "<< y<< " points"<<endl; return y; } while inputting the data use like 2 space 4
12th Jan 2017, 2:16 PM
Akshay S A
+ 1
thank you for responding i will look at it and learn from it! thanks alot!
12th Jan 2017, 2:35 PM
Jeroen Rikken
Jeroen Rikken - avatar
0
Thanks
12th Jan 2017, 2:26 PM
Akshay S A