アニメ!アニメ!

2022年1月21日金曜日

ゲームクラス

#include <iostream>

using namespace std;


#define ELEM(array)  (sizeof (array) / sizeof *(array))


class GameClass

{

public:

    char title[16];

    int  music;

    int  graphic;

    int  Viewoftheworld;


    void Disp();

};


void GameClass::Disp()

{

    cout << "ゲームタイトル : "   << title    << endl

         << " 音楽 : " << music << " 点, "

            "グラフィック : "   << graphic     << " 点, "

            "世界観 : "   << Viewoftheworld << " 点" << endl;

}


int main()

{

    GameClass Gametitle[] = {

        { "原神",   73, 98, 95, },

        { "バイオハザード4", 85, 95, 90, },

        { "FF14",   76, 98, 90, },

    };

    int      i;


    for(i = 0; i < ELEM(Gametitle); i++)

        Gametitle[i].Disp();


    return 0;

}


2022年1月10日月曜日

ポケモン

 #include <iostream>

using namespace std;


void pokemon1()

{

    cout << "ポッチャマを選ぶ" << endl;

cin >> a;

}


void pokemon2()

{

    cout << "ナエトルを選ぶ" << endl;

}


void pokemon3()

{

    cout << "ヒコザルを選ぶ" << endl;

}


int main()

{

    pokemon1();

    pokemon2();

    pokemon3();

    return 0;

}