Advertisement
Guest User

Untitled

a guest
May 24th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. struct punkt3D{
  7. float x;
  8. float y;
  9. float z;
  10. };
  11.  
  12. struct unit{
  13. bool isAlive;
  14. punkt3D loc;
  15. };
  16.  
  17. struct human{
  18. string name;
  19. string surname;
  20. int age;
  21. bool sex;
  22. string birth_date;
  23.  
  24. };
  25.  
  26. int main()
  27. {
  28. punkt3D p1;
  29. p1.x = 5;
  30. p1.y = 3;
  31. p1.z = -7;
  32.  
  33. punkt3D p2;
  34. p1.x = 3;
  35. p1.y = 32;
  36. p1.z = -7;
  37.  
  38. cout << '|' << p1.x << ',' << p1.y << ',' << p1.z << '|' << endl;
  39. cout << '|' << p2.x << ',' << p2.y << ',' << p2.z << '|' << endl;
  40. p2 = p1;
  41. cout << '|' << p2.x << ',' << p2.y << ',' << p2.z << '|' << endl;
  42.  
  43. unit u1;
  44. u1.isAlive = true;
  45. u1.loc.x = 100;u1.loc.x = 100;
  46. u1.loc.y = 200;
  47. u1.loc.z = 150;
  48.  
  49. unit unitsTab[3];
  50. unitsTab[0].isAlive = true;
  51. unitsTab[0].loc.x = 45;
  52. unitsTab[0].loc.y = 20;
  53. unitsTab[0].loc.z = 0;
  54.  
  55. for(int i = 0; i <3; i++){
  56. cout << '{' <<
  57. unitsTab[i].isAlive <<
  58. unitsTab[i].loc.x <<
  59. unitsTab[i].loc.y <<
  60. unitsTab[i].loc.z <<
  61. '}' << endl;
  62. }
  63.  
  64.  
  65. return 0;
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement