#2736
Se citește numărul n și apoi n articole cu structura prenume nume salariu vârstă funcție număr_de_telefon email. Fiecare articol este plasat pe câte o linie, câmpurile sale fiind separate prin câte un spațiu. Câmpurile salariu și vârstă conțin numere naturale, celelalte conțin șiruri de caractere.
Se citește apoi un număr natural p cuprins între 1 și 7 și un caracter c care poate fi + sau -.
Se cere ordonarea celor n articole în funcție de p și c, astfel:
p=1, ordonarea se face după prenume; dacă p=2, ordonarea se face după nume; dacă p=3, ordonarea se face după salariu; dacă p=4, ordonarea se face după vârstă; dacă p=5, ordonarea se face după funcție; dacă p=6, ordonarea se face după număr_de_telefon; dacă p=7, ordonarea se face după email;c are valoarea +, ordonarea va fi crescătoare, iar dacă c are valoarea -, ordonarea va fi descrescătoare;| Problema | Baza De Date | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.01 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64817158 | Utilizator | |
| Fișier | baza_de_date.cpp | Dimensiune | 3.79 KB |
| Data încărcării | 03 Iunie 2026, 11:58 | Scor/rezultat | 0 puncte |
baza_de_date.cpp: In function ‘void nume1(char*, int)’: baza_de_date.cpp:11:10: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 11 | if(c="+") | ^~~ baza_de_date.cpp:11:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 11 | if(c="+") | ~^~~~ baza_de_date.cpp: In function ‘void prenume1(char*, int)’: baza_de_date.cpp:28:10: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 28 | if(c="+") | ^~~ baza_de_date.cpp:28:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 28 | if(c="+") | ~^~~~ baza_de_date.cpp: In function ‘void functie1(char*, int)’: baza_de_date.cpp:45:10: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 45 | if(c="+") | ^~~ baza_de_date.cpp:45:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 45 | if(c="+") | ~^~~~ baza_de_date.cpp: In function ‘void numar_de_telefon1(char*, int)’: baza_de_date.cpp:62:10: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 62 | if(c="+") | ^~~ baza_de_date.cpp:62:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 62 | if(c="+") | ~^~~~ baza_de_date.cpp: In function ‘void email1(char*, int)’: baza_de_date.cpp:79:10: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 79 | if(c="+") | ^~~ baza_de_date.cpp:79:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 79 | if(c="+") | ~^~~~ baza_de_date.cpp: In function ‘void salariu1(char*, int)’: baza_de_date.cpp:96:10: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 96 | if(c="+") | ^~~ baza_de_date.cpp:96:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 96 | if(c="+") | ~^~~~ baza_de_date.cpp: In function ‘void varsta1(char*, int)’: baza_de_date.cpp:113:10: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings] 113 | if(c="+") | ^~~ baza_de_date.cpp:113:9: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 113 | if(c="+") | ~^~~~ baza_de_date.cpp: In function ‘int main()’: baza_de_date.cpp:135:13: warning: ‘c’ is used uninitialized [-Wuninitialized] 135 | cin>>p>>c; | ^ baza_de_date.cpp:131:11: note: ‘c’ was declared here 131 | char* c; | ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | Exemplu | |
| 2 | 0.001 secunde | Caught fatal signal 11 | 10 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 20 | 0 | ||
| 5 | 0.001 secunde | Caught fatal signal 11 | 20 | 0 | ||
| 6 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Baza De Date 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ă.