#2802
Se citește de la tastatură numărul n și un număr p cu valoarea 1 sau 2 și apoi n șiruri de tip nume prenume media1 media2 media3 separate prin spații.
Pentru p=1, se va afișa numărul elevilor care au media generală mai mare sau egală decât media clasei.
Pentru p=2, se va afișa pe primul rând media clasei și pe următoarele n rânduri, numele, prenumele și media generală a fiecărui elev, separate printr-un singur spațiu, sortat descrescător după medie; la medii egale se sortează crescător după nume, iar la nume egale crescător după prenume.
| Problema | Clasa | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.01 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64340210 | Utilizator | |
| Fișier | clasa.cpp | Dimensiune | 1.05 KB |
| Data încărcării | 30 Aprilie 2026, 13:33 | Scor/rezultat | 50 puncte |
clasa.cpp: In function ‘int main()’: clasa.cpp:40:62: warning: comparison between two arrays [-Warray-compare] 40 | if(A[i].m>A[j].m || (A[i].m==A[j].m && A[i].n>A[j].n) || (A[i].m==A[j].m && A[i].n==A[j].n && A[i].p>A[j].p)) | ~~~~~~^~~~~~~ clasa.cpp:40:62: note: use unary ‘+’ which decays operands to pointers or ‘&(A[i].<unnamed struct>::n)[0] > &(A[j].<unnamed struct>::n)[0]’ to compare the addresses clasa.cpp:40:99: warning: comparison between two arrays [-Warray-compare] 40 | if(A[i].m>A[j].m || (A[i].m==A[j].m && A[i].n>A[j].n) || (A[i].m==A[j].m && A[i].n==A[j].n && A[i].p>A[j].p)) | ~~~~~~^~~~~~~~ clasa.cpp:40:99: note: use unary ‘+’ which decays operands to pointers or ‘&(A[i].<unnamed struct>::n)[0] == &(A[j].<unnamed struct>::n)[0]’ to compare the addresses clasa.cpp:40:117: warning: comparison between two arrays [-Warray-compare] 40 | if(A[i].m>A[j].m || (A[i].m==A[j].m && A[i].n>A[j].n) || (A[i].m==A[j].m && A[i].n==A[j].n && A[i].p>A[j].p)) | ~~~~~~^~~~~~~ clasa.cpp:40:117: note: use unary ‘+’ which decays operands to pointers or ‘&(A[i].<unnamed struct>::p)[0] > &(A[j].<unnamed struct>::p)[0]’ to compare the addresses
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.002 secunde | Excellent! | 10 | 10 | Exemplu | |
| 2 | 0.001 secunde | You disappoint me. Master Yoda spoke so highly of you. | 10 | 0 | Exemplu | |
| 3 | 0.001 secunde | Excellent! | 10 | 10 | ||
| 4 | 0.001 secunde | You disappoint me. Master Yoda spoke so highly of you. | 10 | 0 | ||
| 5 | 0.001 secunde | Excellent! | 10 | 10 | ||
| 6 | 0.001 secunde | You disappoint me. Master Yoda spoke so highly of you. | 10 | 0 | ||
| 7 | 0.001 secunde | Excellent! | 10 | 10 | ||
| 8 | 0.001 secunde | You disappoint me. Master Yoda spoke so highly of you. | 10 | 0 | ||
| 9 | 0.001 secunde | Excellent! | 10 | 10 | ||
| 10 | 0.002 secunde | You disappoint me. Master Yoda spoke so highly of you. | 10 | 0 | ||
| Punctaj total | 50 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Clasa 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ă.