mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-15 19:30:07 +08:00
formatting source-code for 153fb7b8a5
This commit is contained in:
@@ -19,8 +19,7 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int main(int argc, char* argv[]) {
|
||||
double GPA;
|
||||
double highestGPA;
|
||||
string name;
|
||||
@@ -35,24 +34,19 @@ int main(int argc, char* argv[])
|
||||
infile >> GPA >> name;
|
||||
highestGPA = GPA;
|
||||
|
||||
while (infile)
|
||||
{
|
||||
if (GPA > highestGPA)
|
||||
{
|
||||
while (infile) {
|
||||
if (GPA > highestGPA) {
|
||||
stk.clear();
|
||||
stk.push(name);
|
||||
highestGPA = GPA;
|
||||
}
|
||||
else if (GPA == highestGPA)
|
||||
{
|
||||
} else if (GPA == highestGPA) {
|
||||
stk.push(name);
|
||||
}
|
||||
infile >> GPA >> name;
|
||||
}
|
||||
cout << "Highest GPA: " << highestGPA << endl;
|
||||
cout << "Students the highest GPA are: " << endl;
|
||||
while (!stk.isEmptyStack())
|
||||
{
|
||||
while (!stk.isEmptyStack()) {
|
||||
cout << stk.top() << endl;
|
||||
stk.pop();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user