#include <iostream> #include <string> int main(void) //tells a pirate story { using std::cout; using std::cin; using std::string; int buddies; int afterBattle; string exit; cout<< "you are a pirate and are walking" << "along in the crime filled \n" << "city of Havana (in 1789). " << "How many of your pirate buddies \n" << "do you bring along? (Any numbers between 11 and 115)\n" //records the amount of friends you bring along cin >> buddies; //calculates the amount of pirates left after the battle. after the battle = 1 + buddies - 10; cout << "suddenly 10 musketeers jump out " << "from the local tavern and \n" << "draw their swords. " << "10 musketeers and 10 pirates die in the \n" << "battle. There are only " << (buddies + 1 - 10) << "pirates left. including you. \n\n"; cout << "the fallen drop a total of 107 gold coins.\n" << "the bounty is split evenly. which works out to " << (107 / after battle) << "gold coins \n" << "for each survivor.\n"; cout << "the last " << (107 % afterbattle) << "are fought over " << "in a big drunken brawl.\n "; cout << "These last few coins are spent on more booze during the\n" << "course of the brawl. Eventually everyone retires\n" << "peacefully on the bar room floor.\n" << "Another successful day as a pirate!\n" return 0; } << (buddies + 1 - 10) << "pirates left, including you.\n\n"; cout << "the fallen drop a total of 107 fold coins.\n" << "the loot is split evenly, which works out to " << (107 / afterBattle) << "gold coins \n" << "for each survivor. leaving "; cout << (107 % afterBattle) << " unclaimed coins.\n"; << "how many of your pirate buddies \n" << "did you bring along? (Any number between 11 and 115)\n"; cout << "you and the others argue over who should get the extra \n" << "coins, and soon a big drunken brawl breaks out!\n\n"; cout << "In the end, you are triumphant and " << (107 / afterBattle) + (107 % afterBattle) << " coins richer!\n\n"; return 0; }
This post has been edited by Salem_c: 06 October 2011 - 10:44 PM
Reason for edit:: Fixed the [code][/code] tags