+ 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; } }
3 Réponses
+ 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
+ 1
thank you for responding i will look at it and learn from it! thanks alot!
0
Thanks