#include <bits/stdc++.h>
using
namespace
std;
struct
student {
string name;
string rollno;
vector<string> subjects;
vector<
int
> marks;
float
cgpa;
};
template
<
typename
S>
void
printv(
const
vector<S>& v)
{
cout <<
"[ "
;
for
(
auto
elem : v) {
cout << elem <<
" "
;
}
cout <<
"]"
;
cout << endl;
}
void
printStudent(student* s)
{
cout <<
"Student Details:"
<< endl;
cout << endl;
cout <<
"Name: "
<< s->name << endl;
cout <<
"Roll Number: "
<< s->rollno << endl;
cout <<
"Subjects: "
;
printv(s->subjects);
cout <<
"Marks: "
;
printv(s->marks);
cout <<
"CGPA "
<< s->cgpa << endl;
}
int
main()
{
student arrayofstudents[10];
arrayofstudents[0].name =
"GeeksforGeeks"
;
arrayofstudents[0].rollno =
"S20200010234"
;
arrayofstudents[0].subjects
= {
"DSA"
,
"OOPS"
,
"DBMS"
,
"CCN"
};
arrayofstudnets[0].marks = { 89, 78, 86, 90 };
arrayofstudnets[0].cgpa = 8.918;
arrayofstudnets[1].name =
"GFG"
;
arrayofstudnets[1].rollno =
"S20200010164"
;
arrayofstudnets[1].subjects
= {
"DSA"
,
"OOPS"
,
"DBMS"
,
"CCN"
};
arrayofstudnets[1].marks = { 89, 80, 89, 80 };
arrayofstudnets[1].cgpa = 8.45;
arrayofstudnets[2].name =
"gfg"
;
arrayofstudnets[2].rollno =
"S20200010169"
;
arrayofstudnets[2].subjects
= {
"DSA"
,
"OOPS"
,
"DBMS"
,
"CCN"
};
arrayofstudnets[2].marks = { 99, 00, 99, 90 };
arrayofstudnets[2].cgpa = 9.47;
for
(
int
i = 0; i < 3; i++) {
printStudent(&arrayofstudnets[i]);
}
return
0;
}