zoukankan      html  css  js  c++  java
  • Lost Fortune 拟人化探险游戏

    // Lost Fortune
    // A personalized adventure
    
    #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;
    
        //get the information
        cout << "Welcome to Lost Fortune
    
    ";
        cout << "Please enter the following for your personalized adventure
    ";
    
        cout << "Enter a number: "; 
        cin >> adventurers;
    
        cout << "Enter a number, smaller than the first: ";
        cin >> killed;
    
        survivors = adventurers - killed;
    
        cout << "Enter your last name: ";
        cin >> leader;
    
        //tell the story
        cout << "
    一个" << adventurers << "人的勇敢的探险队出发进行一项任务";
        cout << "-- 寻找失落的远古矮人宝藏";
        cout << "这个探险队由那个传奇的勇士" << leader << "领导。
    ";
    
        cout << "
    在路上,一群残忍的食人魔伏击了他们。";
        cout << "所有人在" << leader << "的指挥下勇敢的战斗";
        cout << ", 最终,食人魔被击败了,但勇士们也付出了一定的代价。 ";
        cout << "在冒险队中有" << killed << " 名被杀死, ";
        cout << "仅剩下了" << survivors << "名勇士。
    ";
    
        cout << "
    勇士们即将放弃一切希望,"; 
        cout << "但在埋葬死者的时候, ";
        cout << "他们偶然发现了被埋藏的宝藏, ";
        cout << "因此,勇士们将 " << GOLD_PIECES << "枚金币均分。";
        cout << leader << "保留了额外的" << (GOLD_PIECES % survivors);
        cout << "枚金币,以确保不会发生纠纷。
    ";
    
        return 0;
    }

  • 相关阅读:
    从网易与淘宝的font-size思考前端设计稿与工作流
    不吹不黑也不撕,我们就简简单单谈谈Vue
    CSS中各种布局的背后(*FC)
    JavaScript七宗罪和一些槽点
    设计糟糕的 RESTful API 就是在浪费时间!
    JavaScript专题之事件循环
    JavaScript知识点
    掌握git基本功
    延迟情况测试点
    Fiddler监听Https请求响应
  • 原文地址:https://www.cnblogs.com/wlyperfect/p/12368523.html
Copyright © 2011-2022 走看看