Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Student {
- public:
- int indeks;
- char ime[50];
- char prezime[50];
- void input() {
- cin >> indeks >> ime >> prezime;
- }
- void print() {
- cout << "Ime: " << ime << " Prezime: " << prezime << " Indeks: " << indeks << endl;
- }
- };
- int main() {
- int n;
- cin >> n;
- Student niza[n];
- for(int i = 0; i < n; i++) {
- niza[i].input();
- }
- for(int i = 0; i < n; i++) {
- niza[i].print();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement