Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- struct Weapons{
- string name;
- int atk;
- int price;
- };
- /*struct Armors{
- string name;
- int def;
- int price;
- };
- struct Enemies{
- string name;
- int atk;
- int health;
- int def;
- };*/
- int main()
- {
- vector<Weapons> swords;
- vector<Weapons> axes;
- vector<Weapons> staffs;
- swords.push_back(Weapons());
- swords.push_back(Weapons());
- swords[0].name = "Bastard Sword";
- swords[0].atk = 26;
- swords[0].price = 35;
- swords[1].name = "Broad Sword";
- swords[1].atk = 32;
- swords[1].price = 50;
- for (int i = 0; i < 2; i++)
- {
- cout << swords[i].name << ' ' << swords[i].atk << ' ' << swords[i].price << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement