|
-
August 31st, 2011, 11:39 AM
#1
C++ Score Program HELP
#include<windows.h>
#include<iostream.h>
int main()
{
int start = 100;
int zan;
int bri;
int ste;
int zanlost;
int brilost;
int stelost;
int total;
int round=0;
int winner;
zan=start;
bri=start;
ste=start;
do{
cout<<"Please enter the number lost for each player, enter the winner as 0\n";
cout<<"Zan=";
cin>>zanlost;
cout<<"Bri=";
cin>>brilost;
cout<<"Ste=";
cin>>stelost;
if(zan==0)
{
zan=zan+brilost+stelost;
bri=bri-brilost;
ste=ste-stelost;
}
if(bri==0)
{
bri=bri+zanlost+stelost;
zan=zan-zanlost;
ste=ste-stelost;
}
if(ste==0)
{
ste=ste+zanlost+brilost;
zan=zan-zanlost;
bri=bri-brilost;
}
round=round+1;
cout<<"round="<<round<<"\n\n";
cout<<"Zan="<<zan<<"\n";
cout<<"Bri="<<bri<<"\n";
cout<<"Ste="<<ste<<"\n";
total=zan+bri+ste;
cout<<"Total "<<total<<"\n";
}while(round>-1);
}
Ok, the aim of the program is to work out each players score at the end or a round. I believe all my calculations are correct however the program just dosnt do any of the calculations.
If someone could please help me with this it would be much appreciated.
Thanks in advanced Steven.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|