#2736
Baza De Date
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 | #51106918 | Utilizator | |
Fișier | baza_de_date.cpp | Dimensiune | 4.32 KB |
Data încărcării | 23 Mai 2024, 22:44 | Scor / rezultat | Eroare de compilare |
baza_de_date.cpp:16:3: error: stray '\310' in program char funcție[256]; ^ baza_de_date.cpp:16:3: error: stray '\233' in program baza_de_date.cpp:17:3: error: stray '\304' in program char număr_de_telefon[256]; ^ baza_de_date.cpp:17:3: error: stray '\203' in program baza_de_date.cpp:20:3: error: stray '\303' in program int vârstă; ^ baza_de_date.cpp:20:3: error: stray '\242' in program baza_de_date.cpp:20:3: error: stray '\304' in program baza_de_date.cpp:20:3: error: stray '\203' in program baza_de_date.cpp:30:8: error: stray '\303' in program cin>>angajat[i].vârstă>>angajat[i].funcție>>angajat[i].număr_de_telefon>>angajat[i].email; ^ baza_de_date.cpp:30:8: error: stray '\242' in program baza_de_date.cpp:30:8: error: stray '\304' in program baza_de_date.cpp:30:8: error: stray '\203' in program baza_de_date.cpp:30:8: error: stray '\310' in program baza_de_date.cpp:30:8: error: stray '\233' in program baza_de_date.cpp:30:8: error: stray '\304' in program baza_de_date.cpp:30:8: error: stray '\203' in program baza_de_date.cpp:93:17: error: stray '\303' in program if(angajat[i].vârstă<angajat[j].vârstă) ^ baza_de_date.cpp:93:17: error: stray '\242' in program baza_de_date.cpp:93:17: error: stray '\304' in program baza_de_date.cpp:93:17: error: stray '\203' in program baza_de_date.cpp:93:17: error: stray '\303' in program baza_de_date.cpp:93:17: error: stray '\242' in program baza_de_date.cpp:93:17: error: stray '\304' in program baza_de_date.cpp:93:17: error: stray '\203' in program baza_de_date.cpp:100:17: error: stray '\303' in program if(angajat[i].vârstă>angajat[j].vârstă) ^ baza_de_date.cpp:100:17: error: stray '\242' in program baza_de_date.cpp:100:17: error: stray '\304' in program baza_de_date.cpp:100:17: error: stray '\203' in program baza_de_date.cpp:100:17: error: stray '\303' in program baza_de_date.cpp:100:17: error: stray '\242' in program baza_de_date.cpp:100:17: error: stray '\304' in program baza_de_date.cpp:100:17: error: stray '\203' in program baza_de_date.cpp:110:17: error: stray '\310' in program if(strcmp(angajat[i].funcție,angajat[j].funcție)<0) ^ baza_de_date.cpp:110:17: error: stray '\233' in program baza_de_date.cpp:110:17: error: stray '\310' in program baza_de_date.cpp:110:17: error: stray '\233' in program baza_de_date.cpp:117:17: error: stray '\310' in program if(strcmp(angajat[i].funcție,angajat[j].funcție)>0) ^ baza_de_date.cpp:117:17: error: stray '\233' in program baza_de_date.cpp:117:17: error: stray '\310' in program baza_de_date.cpp:117:17: error: stray '\233' in program baza_de_date.cpp:127:17: error: stray '\304' in program if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)<0) ^ baza_de_date.cpp:127:17: error: stray '\203' in program baza_de_date.cpp:127:17: error: stray '\304' in program baza_de_date.cpp:127:17: error: stray '\203' in program baza_de_date.cpp:134:17: error: stray '\304' in program if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)>0) ^ baza_de_date.cpp:134:17: error: stray '\203' in program baza_de_date.cpp:134:17: error: stray '\304' in program baza_de_date.cpp:134:17: error: stray '\203' in program baza_de_date.cpp:162:5: error: stray '\303' in program cout<<angajat[i].vârstă<<" "; ^ baza_de_date.cpp:162:5: error: stray '\242' in program baza_de_date.cpp:162:5: error: stray '\304' in program baza_de_date.cpp:162:5: error: stray '\203' in program baza_de_date.cpp:163:5: error: stray '\310' in program cout<<angajat[i].funcție<<" "; ^ baza_de_date.cpp:163:5: error: stray '\233' in program baza_de_date.cpp:164:5: error: stray '\304' in program cout<<angajat[i].număr_de_telefon<<" "; ^ baza_de_date.cpp:164:5: error: stray '\203' in program baza_de_date.cpp:16:8: error: expected ';' at end of member declaration char funcție[256]; ^ baza_de_date.cpp:16:14: error: 'ie' does not name a type char funcție[256]; ^ baza_de_date.cpp:17:8: error: expected ';' at end of member declaration char număr_de_telefon[256]; ^ baza_de_date.cpp:17:13: error: 'r_de_telefon' does not name a type char număr_de_telefon[256]; ^ baza_de_date.cpp:20:7: error: expected ';' at end of member declaration int vârstă; ^ baza_de_date.cpp:20:10: error: 'rst' does not name a type int vârstă; ^ baza_de_date.cpp: In function 'int main()': baza_de_date.cpp:30:27: error: expected ';' before 'rst' cin>>angajat[i].vârstă>>angajat[i].funcție>>angajat[i].număr_de_telefon>>angajat[i].email; ^ baza_de_date.cpp:93:34: error: expected ')' before 'rst' if(angajat[i].vârstă<angajat[j].vârstă) ^ baza_de_date.cpp:100:34: error: expected ')' before 'rst' if(angajat[i].vârstă>angajat[j].vârstă) ^ baza_de_date.cpp:110:44: error: expected ')' before 'ie' if(strcmp(angajat[i].funcție,angajat[j].funcție)<0) ^ baza_de_date.cpp:110:64: error: expected ')' before 'ie' if(strcmp(angajat[i].funcție,angajat[j].funcție)<0) ^ baza_de_date.cpp:110:66: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(angajat[i].funcție,angajat[j].funcție)<0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from baza_de_date.cpp:10: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ baza_de_date.cpp:110:66: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(angajat[i].funcție,angajat[j].funcție)<0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from baza_de_date.cpp:10: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ baza_de_date.cpp:117:44: error: expected ')' before 'ie' if(strcmp(angajat[i].funcție,angajat[j].funcție)>0) ^ baza_de_date.cpp:117:64: error: expected ')' before 'ie' if(strcmp(angajat[i].funcție,angajat[j].funcție)>0) ^ baza_de_date.cpp:117:66: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(angajat[i].funcție,angajat[j].funcție)>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from baza_de_date.cpp:10: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ baza_de_date.cpp:117:66: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(angajat[i].funcție,angajat[j].funcție)>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from baza_de_date.cpp:10: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ baza_de_date.cpp:127:43: error: expected ')' before 'r_de_telefon' if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)<0) ^ baza_de_date.cpp:127:72: error: expected ')' before 'r_de_telefon' if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)<0) ^ baza_de_date.cpp:127:84: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)<0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from baza_de_date.cpp:10: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ baza_de_date.cpp:127:84: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)<0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from baza_de_date.cpp:10: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ baza_de_date.cpp:134:43: error: expected ')' before 'r_de_telefon' if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)>0) ^ baza_de_date.cpp:134:72: error: expected ')' before 'r_de_telefon' if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)>0) ^ baza_de_date.cpp:134:84: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from baza_de_date.cpp:10: /usr/include/string.h:144:12: error: initializing argument 1 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ baza_de_date.cpp:134:84: error: invalid conversion from 'char' to 'const char*' [-fpermissive] if(strcmp(angajat[i].număr_de_telefon,angajat[j].număr_de_telefon)>0) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from baza_de_date.cpp:10: /usr/include/string.h:144:12: error: initializing argument 2 of 'int strcmp(const char*, const char*)' [-fpermissive] extern int strcmp (const char *__s1, const char *__s2) ^ baza_de_date.cpp:162:25: error: expected ';' before 'rst' cout<<angajat[i].vârstă<<" "; ^ baza_de_date.cpp:163:28: error: expected ';' before 'ie' cout<<angajat[i].funcție<<" "; ^ baza_de_date.cpp:164:27: error: expected ';' before 'r_de_telefon' cout<<angajat[i].număr_de_telefon<<" "; ^
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ă.