#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 | #57501236 | Utilizator | |
Fișier | qclasa.cpp | Dimensiune | 568 B |
Data încărcării | 02 Aprilie 2025, 15:32 | Scor / rezultat | Eroare de compilare |
qclasa.cpp:25:15: warning: multi-character character constant [-Wmultichar] cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^ qclasa.cpp:25:26: warning: multi-character character constant [-Wmultichar] cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^ qclasa.cpp: In function 'int main()': qclasa.cpp:14:13: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') {cin>>f[i].cod>>f[i].m>>f[i].a; ^ qclasa.cpp:14:23: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') {cin>>f[i].cod>>f[i].m>>f[i].a; ^ qclasa.cpp:14:31: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') {cin>>f[i].cod>>f[i].m>>f[i].a; ^ qclasa.cpp:15:10: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') if(f[i].m==10) ^ qclasa.cpp:17:13: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') med+=f[i].m; ^ qclasa.cpp:18:11: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') if(f[i].a>f[amax1].a) ^ qclasa.cpp:18:18: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') if(f[i].a>f[amax1].a) ^ qclasa.cpp:21:13: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') if(f[i].a>f[amax2].a) ^ qclasa.cpp:21:20: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') if(f[i].a>f[amax2].a) ^ qclasa.cpp:25:33: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^ qclasa.cpp:25:52: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^ qclasa.cpp:25:69: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^ qclasa.cpp:25:87: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^ qclasa.cpp:25:96: error: expected primary-expression before '.' token cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^ qclasa.cpp:25:108: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^ qclasa.cpp:25:125: error: no match for 'operator[]' (operand types are 'main()::<anonymous struct>' and 'int') cout<<k<<'/n'<<med<<'/n'<<f[amax1].cod<<' '<<f[amax1].m<<' '<<f[amax1].a<<'\n'<<f[amax2]<<.cod<<' '<<f[amax2].m<<' '<<f[amax2].a; ^
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ă.