Răspuns :
Răspuns:
O sa fac tot programul
Explicație:
#include <iostream>
#include <cstring>
using namespace std;
float mediaG;
int main ()
{
struct Elev {
char nume[20], optiune[10];
float notaR, notaM, notaO;
} x, y;
cin >> x.nume >> x.optiune >> x.notaR >> x.notaM >> x.notaO;
cin >> y.nume >> y.optiune >> y.notaR >> y.notaM >> y.notaO;
//subpunctul a)
cout << "subpunctul a" << endl;
mediaG = (x.notaR + x.notaM + x.notaO)/3;
cout << mediaG << endl;
//subpunctul b)
cout << "subpunctul b" << endl;
if (strstr(x.optiune, "istorie")) cout << x.nume << endl;
if (strstr(y.optiune, "istorie")) cout << y.nume << endl;
//subpunctul c)
cout << "subpunctul c" << endl;
if (strcmp(x.nume, y.nume) < 0)
cout << x.nume << " " << y.nume;
else cout << y.nume << " " << x.nume;
return 0;
}
Vă mulțumim pentru vizita pe site-ul nostru dedicat Informatică. Sperăm că informațiile prezentate v-au fost utile. Dacă aveți întrebări sau aveți nevoie de suport suplimentar, nu ezitați să ne contactați. Ne bucurăm să vă revedem și vă invităm să ne adăugați în lista de favorite!