mirror of
https://github.com/szymon-jozef/ZUT-notatki.git
synced 2026-09-07 12:10:40 +02:00
21 lines
387 B
C++
21 lines
387 B
C++
#include <iostream>
|
|
#include <vector>
|
|
|
|
struct Licznik {
|
|
std::vector<int> dane;
|
|
Licznik(std::initializer_list<int> il) : dane(il) {}
|
|
void wyswietl() const {
|
|
for (int x : dane)
|
|
std::cout << x << " ";
|
|
std::cout << "\n";
|
|
}
|
|
};
|
|
|
|
int main() {
|
|
Licznik l1{1, 2, 3};
|
|
Licznik l2 = {4, 5, 6};
|
|
// Licznik l3(7, 8, 9);
|
|
l1.wyswietl(); // 1 2 3
|
|
l2.wyswietl(); // 4 5 6
|
|
}
|