Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct punkt3D{
- float x;
- float y;
- float z;
- };
- struct unit{
- bool isAlive;
- punkt3D loc;
- };
- struct human{
- string name;
- string surname;
- int age;
- bool sex;
- string birth_date;
- };
- int main()
- {
- punkt3D p1;
- p1.x = 5;
- p1.y = 3;
- p1.z = -7;
- punkt3D p2;
- p1.x = 3;
- p1.y = 32;
- p1.z = -7;
- cout << '|' << p1.x << ',' << p1.y << ',' << p1.z << '|' << endl;
- cout << '|' << p2.x << ',' << p2.y << ',' << p2.z << '|' << endl;
- p2 = p1;
- cout << '|' << p2.x << ',' << p2.y << ',' << p2.z << '|' << endl;
- unit u1;
- u1.isAlive = true;
- u1.loc.x = 100;u1.loc.x = 100;
- u1.loc.y = 200;
- u1.loc.z = 150;
- unit unitsTab[3];
- unitsTab[0].isAlive = true;
- unitsTab[0].loc.x = 45;
- unitsTab[0].loc.y = 20;
- unitsTab[0].loc.z = 0;
- for(int i = 0; i <3; i++){
- cout << '{' <<
- unitsTab[i].isAlive <<
- unitsTab[i].loc.x <<
- unitsTab[i].loc.y <<
- unitsTab[i].loc.z <<
- '}' << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement