Есть структура student (поля: Фамилия, Имя, Группу). Необходимо вывести тех студентов, у которых в фамилии есть буква "о", а в имени буквы "о" нет. Сделал такой код, но понимаю что это полный бред)
#include <iostream>
#include <cassert>
#include <string>
struct student
{
std::string LastName;
std::string FirstName;
int group;
};
int main()
{
setlocale(LC_ALL, "Russian");
using namespace std;
int n=5;
student * st = new student[n];
for (int i = 0; i!= n; i++)
{
cout << "Введите Фамилию студента" << endl;
cin >> st[i].LastName;
cout << "Введите Имя студента" << endl;
cin >> st[i].FirstName;
cout << "Номер группы" << endl;
cin >> st[i].group;
for (int j = 0; j != n; j++)
{
if (st[i].LastName == "о" and st[i].FirstName != "о")
{
cout << st[i].LastName << " " << st[i].FirstName << " " << st[i].group << "\n";
}
}
}
}