hi everyone im new to this and in am having some issues making this work correctly first when i run the debugger it comes out with some stuff joined together like numbers and words and getting it to calculate the 750 pieces of gold with the reminding explorers not coming out correctly either can i get so advice on what im doing wrong

#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()

int Iexplorers;
int IexplorersLostInBattle;
double survived;
cout << "Welcome to Lost Forturne!" << endl;
cout << "Please answer the following question for your personalized adventure:" << endl
<< "Enter the number of Explorers:" << endl;
cin >> Iexplorers;

cout << "Enter the number of Explorers Lost in Battle:" << endl;
cin >> IexplorersLostInBattle;

cout << "You bravely led" << Iexplorers << "explorers on a quest for gold." << endl
<< "The group fought a band of ogres and lost" << IexplorersLostInBattle << "members." << endl
<< "only" << Iexplorers - IexplorersLostInBattle << "survived." << endl;
cout << "The party was about to give up when they stumbled upon the" << endl
<<"buried fortune of 750 gold pieces. The group split the loot evenly" << endl
<< "and as the quest leader you kept the extra 2 gold pieces." << endl;
return 0;

Edited by WolfPack: Added [CODE=c++][/CODE] Tags

6 Years
Discussion Span
Last Post by jonsca

Please put some code tags on your post. There's still time to edit. Click the Edit button underneath your name and surround your code by [code] //code here [/code].


please try to post your code with in code tag with correct format, you code just look like a scrap


getting it to calculate the 750 pieces of gold

Where in your program is it doing that?

Also, I didn't have any problem with getting a figure for remaining explorers (except you did not pad your strings with a space, it just gets jammed in there).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.