#include <iostream>
#include <string>
using namespace std;
float st[25];
float nd[25];
float rd[25];
string students[25];
int main() {
bool flag = 0; //We make a flag, because we need only one failed exam.
for (int i = 0; i < 25; ++i) { //In order not to make the code highly branched, we create one cycle in which we will raise the flag if we find a student who has failed at least one exam.
if(st[i] < 40)
flag = 1;
if(nd[i] < 40)
flag = 1;
if(rd[i] < 40)
flag = 1;
if (flag)
cout << students[i];
flag = 0;
}
}
Comments
Leave a comment