Facebook
From Small Pheasant, 1 Week ago, written in C++.
Embed
Download Paste or View Raw
Hits: 30
  1. #include <iostream>
  2. #include <conio.h>
  3. #include <vector>
  4.  
  5. /*
  6.  
  7. 11-09-2019
  8.  
  9.  
  10. MŇö w Lekkoatletyce
  11. Konkurencja - skok w dal
  12.  
  13.  
  14. -----------------------------
  15. LP
  16. */  
  17.  
  18. class Jumper{
  19.         public:
  20.                 Jumper(std::string Name, std::string Nationality, int j[3]){
  21.                         this->Name = Name;
  22.                         this->Nationality = Nationality;
  23.                        
  24.                         for(int i=0;i<3; i++){
  25.                                 this->Jumps[i] =  j[i];
  26.                         }
  27.                         this->Sum = j[0] + j[1] + j[3];
  28.                 };
  29.                 std::string Name;
  30.                 std::string Nationality;
  31.                 int Jumps[3];
  32.                 int Sum;
  33.                
  34. };
  35.  
  36.  
  37.  
  38. int main(){
  39.         std::vector<Jumper> jumpers;
  40.         int jumps[3];
  41.        
  42.        
  43.         jumps[0] = 5; jumps[1] = 6; jumps[2] = 2;
  44.         jumpers.push_back(Jumper("Miltiadis Tendoglu", "GRE", jumps));
  45.        
  46.         jumps[0] = 6; jumps[1] = 3; jumps[2] = 0;
  47.         jumpers.push_back(Jumper("Thobias N. Montler", "SWE", jumps));
  48.        
  49.         jumps[0] = 3; jumps[1] = 0; jumps[2] = 1;
  50.         jumpers.push_back(Jumper("Marcell Jacobs", "ITA", jumps));
  51.        
  52.         jumps[0] = 4; jumps[1] = 6; jumps[2] = 2;
  53.         jumpers.push_back(Jumper("Jean-Pierre Bertrand", "FRA", jumps));
  54.        
  55.         jumps[0] = 5; jumps[1] = 3; jumps[2] = 2;
  56.         jumpers.push_back(Jumper("Eusebio C√°ceres", "ESP", jumps));
  57.        
  58.         jumps[0] = 1; jumps[1] = 6; jumps[2] = 2;
  59.         jumpers.push_back(Jumper("Jacob Fincham-Dukes", "GB", jumps));
  60.        
  61.         jumps[0] = 5; jumps[1] = 3; jumps[2] = 2;
  62.         jumpers.push_back(Jumper("Henri V√§yrynen", "FIN", jumps));
  63.        
  64.         jumps[0] = 8; jumps[1] = 6; jumps[2] = 2;
  65.         jumpers.push_back(Jumper("Yann Randrianasolo", "FRA", jumps));
  66.        
  67.         jumps[0] = 5; jumps[1] = 6; jumps[2] = 2;
  68.         jumpers.push_back(Jumper("Tomasz Jaszczuk", "POL", jumps));
  69.        
  70.         jumps[0] = 3; jumps[1] = 6; jumps[2] = 2;
  71.         jumpers.push_back(Jumper("H√©ctor Santos", "ESP", jumps));
  72.        
  73.         std::cout << "MS W LEKKOATLETYCE\nKonkurencja - skok w dal\n-----------------------------------------------------\n";
  74.         for(int i = 0; i < jumpers.size(); i++){
  75.                 std::cout << i << "| " << jumpers[i].Name << "\tKraj: " << jumpers[i].Nationality << " I Skok: " << jumpers[i].Jumps[0] << " II Skok: " << jumpers[i].Jumps[1] << " III Skok: " << jumpers[i].Jumps[2] << " Suma:" << jumpers[i].Sum << std::endl;
  76.                
  77.         }
  78. }