Untitled
unknown
c_cpp
2 years ago
772 B
5
Indexable
#include <iostream> #include <queue> using namespace std; int main() { queue <string> studentNames; queue <float> studentGrades; queue <string> topStudents; string names; float grades; cout<<"Enter names: "; for (int i = 0 ; i < 3; i++) { cout<< "Enter name of student " << i+1<<" : "<<endl; cin >> names; cout<< "Enter grade of student " << i+1<<" : "<<endl; cin>>grades; studentNames.push(names); studentGrades.push(grades); } for (int i = 0 ; i < studentNames.size(); i++){ if (studentGrades.front()> 70){ cout<< studentNames.front()<<endl; } studentNames.pop(); studentGrades.pop(); } return 0; }
Editor is loading...