Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <queue>
- #include <cstring>
- using namespace std;
- class Student {
- protected:
- int indeks;
- public:
- static int broj_na_fakultet;
- Student(int ind) {
- indeks = ind;
- }
- int get_indeks() {
- return indeks;
- }
- static int get_broj() {
- return broj_na_fakultet;
- }
- static void set_broj(int broj) {
- broj_na_fakultet = broj;
- }
- };
- int Student::broj_na_fakultet = 0;
- int main() {
- Student s1 (123);
- Student s2(456);
- s1.set_broj(14);
- cout << s1.get_broj() << endl;
- cout << s2.get_broj() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement