#3164
qclasa
Se dau n
, reprezentând numărul de elevi apoi, pe câte un rând, datele fiecărui elev: codul (număr natural de maxim 4
cifre), media la informatică (număr natural de la 1
la 10
) și numărul de absențe. Definiți un tip structură pentru a putea memora datele unui elev și rezolvați cerințele:
a) memorați datele tuturor elevilor într-un vector de structuri de tipul definit;
b) afișați numărul de elevi cu media 10
c) afișați media clasei (se va afișa doar partea întreagă a ei).
d) afișați primii doi elevi după absențe (elevii cu cele mai multe absențe). Dacă sunt mai mulți elevi cu același număr de absențe se afișează în ordine crescătoare a codului. Dacă sunt mai mult de doi elevi număr maxim de absențe se afișează doar doi.
Problema | qclasa | Operații I/O |
qclasa.in /qclasa.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49057700 | Utilizator | |
Fișier | qclasa.cpp | Dimensiune | 916 B |
Data încărcării | 13 Februarie 2024, 23:30 | Scor / rezultat | Eroare de compilare |
qclasa.cpp:9:5: error: 'e' does not name a type { e[50]; ^ qclasa.cpp:11:1: error: expected ';' after struct definition } ^ qclasa.cpp: In function 'int main()': qclasa.cpp:17:5: error: 'fin' was not declared in this scope fin>>n; ^ qclasa.cpp:17:10: error: 'n' was not declared in this scope fin>>n; ^ qclasa.cpp:19:14: error: request for member 'medie' in 'e[i]', which is of non-class type 'int' { fin>>e[i].medie>>e[i].cod>>e[i].abs; ^ qclasa.cpp:19:26: error: request for member 'cod' in 'e[i]', which is of non-class type 'int' { fin>>e[i].medie>>e[i].cod>>e[i].abs; ^ qclasa.cpp:19:36: error: request for member 'abs' in 'e[i]', which is of non-class type 'int' { fin>>e[i].medie>>e[i].cod>>e[i].abs; ^ qclasa.cpp:20:6: error: 'nr' was not declared in this scope nr++; ^ qclasa.cpp:21:21: error: request for member 'medie' in 'e[i]', which is of non-class type 'int' suma=suma+e[i].medie; ^ qclasa.cpp:22:11: error: request for member 'medie' in 'e[i]', which is of non-class type 'int' if(e[i].medie==10)cnt++; ^ qclasa.cpp:24:2: error: 'fout' was not declared in this scope fout<<cnt<<'\n'<<suma/nrelevi<<'\n'; ^ qclasa.cpp:26:13: error: request for member 'abs' in 'e[i]', which is of non-class type 'int' { if(e[i].abs>e[i+1].abs){ int aux=e[i].abs; ^ qclasa.cpp:26:24: error: request for member 'abs' in 'e[(i + 1)]', which is of non-class type 'int' { if(e[i].abs>e[i+1].abs){ int aux=e[i].abs; ^ qclasa.cpp:26:43: error: request for member 'abs' in 'e[i]', which is of non-class type 'int' { if(e[i].abs>e[i+1].abs){ int aux=e[i].abs; ^ qclasa.cpp:27:30: error: request for member 'abs' in 'e[i]', which is of non-class type 'int' e[i].abs=e[i+1].abs; ^ qclasa.cpp:27:41: error: request for member 'abs' in 'e[(i + 1)]', which is of non-class type 'int' e[i].abs=e[i+1].abs; ^ qclasa.cpp:28:31: error: request for member 'abs' in 'e[(i + 1)]', which is of non-class type 'int' e[i+1].abs=aux;} ^ qclasa.cpp:29:12: error: request for member 'abs' in 'e[i]', which is of non-class type 'int' if(e[i].abs==e[i+1].abs) ^ qclasa.cpp:29:24: error: request for member 'abs' in 'e[(i + 1)]', which is of non-class type 'int' if(e[i].abs==e[i+1].abs) ^ qclasa.cpp:30:16: error: request for member 'cod' in 'e[i]', which is of non-class type 'int' if(e[i].cod>e[i+1].cod){ int aux=e[i].cod; ^ qclasa.cpp:30:27: error: request for member 'cod' in 'e[(i + 1)]', which is of non-class type 'int' if(e[i].cod>e[i+1].cod){ int aux=e[i].cod; ^ qclasa.cpp:30:46: error: request for member 'cod' in 'e[i]', which is of non-class type 'int' if(e[i].cod>e[i+1].cod){ int aux=e[i].cod; ^ qclasa.cpp:31:30: error: request for member 'cod' in 'e[i]', which is of non-class type 'int' e[i].cod=e[i+1].cod; ^ qclasa.cpp:31:41: error: request for member 'cod' in 'e[(i + 1)]', which is of non-class type 'int' e[i].cod=e[i+1].cod; ^ qclasa.cpp:32:31: error: request for member 'cod' in 'e[(i + 1)]', which is of non-class type 'int' e[i+1].cod=aux;} ^ qclasa.cpp:36:17: error: request for member 'medie' in 'e[i]', which is of non-class type 'int' fout<<e[i].medie<<' '<<e[i].cod<<' '<<e[i].abs<<"\n"; ^ qclasa.cpp:36:34: error: request for member 'cod' in 'e[i]', which is of non-class type 'int' fout<<e[i].medie<<' '<<e[i].cod<<' '<<e[i].abs<<"\n"; ^ qclasa.cpp:36:49: error: request for member 'abs' in 'e[i]', which is of non-class type 'int' fout<<e[i].medie<<' '<<e[i].cod<<' '<<e[i].abs<<"\n"; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema qclasa face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.