5_4
This commit is contained in:
parent
c101429a03
commit
4d9daac7c5
|
@ -1,13 +1,31 @@
|
|||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <random>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
struct Osoba {
|
||||
string imie;
|
||||
string nazwisko;
|
||||
int wiek;
|
||||
int pesel;
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
vector<Osoba> osoby;
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Osoba tmp;
|
||||
tmp.imie = "Andrzej" + to_string(rand() % 100);
|
||||
tmp.nazwisko = "Kowalski" + to_string(rand() % 100);
|
||||
tmp.pesel = rand() % 500000 + 1000000;
|
||||
tmp.wiek = rand() % 20 + 10;
|
||||
osoby.push_back(tmp);
|
||||
}
|
||||
|
||||
for (int i = 0; i < osoby.size(); i++) {
|
||||
cout << i << ". " << osoby.at(i).imie << ' ' << osoby.at(i).nazwisko << ", wiek " << osoby.at(i).wiek << ", pesel " << osoby.at(i).pesel << endl;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue