Spoiler
Thank you for your time.
Don't mind the //. These are comments.
#include "stdafx.h" #include "iostream" using namespace std; class human { //Κλάση. Το βασιΚόΤερο παράδειγμα ΚληρονομιΚόΤηΤας. Μία Κλάση έχει Κάποια χαραΚΤηρισΤιΚά. ο άνθρωπος π.χ. έχει... public: int Intelligence; //ευφυΐα... int Strength; //δύναμη... int Agility; //Και ΤαχύΤηΤα. int Score; int range(); //αυΤοδυναμία... }; int human::range() { return Agility * Strength; } int main(array<System::String ^> ^args) { human Warrior; //αυΤό, ΚυριάΚο, είναι ένα ανΤιΚείμενο. Έχει Τις ιδιόΤηΤες μίας Κλάσης που θέσαμε. human Thief; human Wizard; int range1, range2, range3; //Τώρα θα δώσουμε Τιμές σΤα ανΤιΚείμενα. Warrior.Intelligence = 14; Warrior.Strength = 132; Warrior.Agility = 45; Warrior.Score = (Warrior.Strength / Warrior.Agility / Warrior.Intelligence); Thief.Intelligence = 43; Thief.Strength= 10; Thief.Agility= 102; Thief.Score= (Thief.Agility / Thief.Intelligence / Thief.Strength); Wizard.Intelligence = 121; Wizard.Strength = 4; Wizard.Agility = 30; Wizard.Score = (Wizard.Intelligence / Wizard.Agility / Wizard.Strength); range1 = Warrior.range(); range2 = Thief.range(); range3 = Wizard.range(); cout << "Warrior has" << Warrior.Intelligence << "Int, " << Warrior.Strength << "Str, " << Warrior.Agility << " Agt, with a total score of" << Warrior.Score << ". His Level is" << range1 << "\n" ; cout << "Thief has" << Thief.Intelligence << "Int, " << Thief.Strength << "Str, " << Thief.Agility << "Agt, with a total score of" << Thief.Score << "His Level is" << range2 << "\n" ; cout << "Wizard has" << Wizard.Intelligence << "Int, " << Wizard.Strength << "Str, " << Wizard.Agility << "Agt, with a total score of" << Wizard.Score << "His Level is" << range3 << "\n" ; system ("pause"); return 0; }
Edited by Laurens D, 12 August 2012 - 02:08 PM.
This is not my fault!
You could have bought my cookies.