//Lost Fortune
//Personalized Adventure Game
#include <iostream>
#include <string>
using std::cout;
using std::cin;
using std::endl;
using std::string;
int main()
{
const int GOLD_PIECES = 900;
int adventurers, killed, survivors;
string leader;
//Information
cout << "Welcome to the Lost Fortune\n\n";
cout << "Please enter the following information\n";
cout << "Enter a number: ";
cin >> adventurers;
cout << "Enter a number smaller than" << adventurers << ": ";
cin >> killed;
survivors = adventurers - killed;
cout << "Enter your last name: ";
cin >> leader;
//Story
cout << "\nA brave group of " << adventurers << " set out on a quest ";
cout << "-- to find the treasures of Smaug.";
cout << "The group was led by the charming hobbit " << leader << ".\n";
cout << "\nUnfortunately, Smaug was awake and fought the band of hobbits and dwarves.";
cout << "Luckily, the group had a fine leader, " << leader << ".";
cout << "And so Smaug was defeated, but at cost...";
cout << "Of the party, " << killed << " were slain, leaving just " << survivors << ".";
cout << "The remainder of the band shared the treasure of " << GOLD_PIECES << " gold pieces.";
cout << "Of course, " << leader << " took the remaing " << (GOLD_PIECES % survivors);
cout << ", to keep things fair.";
return 0;
}
I have this in Dev-C++ and it compiles fine, but the second it runs I get the typical Vista fail message.
Quote
[Name].exe has stopped working. Windows will now check for a solution.
Does anybody know what I am doing wrong?


Sign In
Create Account

Back to top










