#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 | #53085261 | Utilizator | |
Fișier | baza_de_date.cpp | Dimensiune | 3.24 KB |
Data încărcării | 17 Octombrie 2024, 10:46 | Scor / rezultat | Eroare de compilare |
baza_de_date.cpp: In function 'int main()': baza_de_date.cpp:32:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:33:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:33:13: error: expected ';' before '}' token baza_de_date.cpp:34:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:34:9: error: expected '(' before '}' token baza_de_date.cpp:34:9: error: expected primary-expression before '}' token baza_de_date.cpp:34:9: error: expected ')' before '}' token baza_de_date.cpp:34:9: error: expected ';' before '}' token baza_de_date.cpp:41:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:42:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:42:13: error: expected ';' before '}' token baza_de_date.cpp:43:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:43:9: error: expected '(' before '}' token baza_de_date.cpp:43:9: error: expected primary-expression before '}' token baza_de_date.cpp:43:9: error: expected ')' before '}' token baza_de_date.cpp:43:9: error: expected ';' before '}' token baza_de_date.cpp:55:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:56:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:56:13: error: expected ';' before '}' token baza_de_date.cpp:57:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:57:9: error: expected '(' before '}' token baza_de_date.cpp:57:9: error: expected primary-expression before '}' token baza_de_date.cpp:57:9: error: expected ')' before '}' token baza_de_date.cpp:57:9: error: expected ';' before '}' token baza_de_date.cpp:64:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:65:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:65:13: error: expected ';' before '}' token baza_de_date.cpp:66:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:66:9: error: expected '(' before '}' token baza_de_date.cpp:66:9: error: expected primary-expression before '}' token baza_de_date.cpp:66:9: error: expected ')' before '}' token baza_de_date.cpp:66:9: error: expected ';' before '}' token baza_de_date.cpp:78:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:79:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:79:13: error: expected ';' before '}' token baza_de_date.cpp:80:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:80:9: error: expected '(' before '}' token baza_de_date.cpp:80:9: error: expected primary-expression before '}' token baza_de_date.cpp:80:9: error: expected ')' before '}' token baza_de_date.cpp:80:9: error: expected ';' before '}' token baza_de_date.cpp:87:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:88:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:88:13: error: expected ';' before '}' token baza_de_date.cpp:89:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:89:9: error: expected '(' before '}' token baza_de_date.cpp:89:9: error: expected primary-expression before '}' token baza_de_date.cpp:89:9: error: expected ')' before '}' token baza_de_date.cpp:89:9: error: expected ';' before '}' token baza_de_date.cpp:101:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:102:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:102:13: error: expected ';' before '}' token baza_de_date.cpp:103:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:103:9: error: expected '(' before '}' token baza_de_date.cpp:103:9: error: expected primary-expression before '}' token baza_de_date.cpp:103:9: error: expected ')' before '}' token baza_de_date.cpp:103:9: error: expected ';' before '}' token baza_de_date.cpp:110:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:111:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:111:13: error: expected ';' before '}' token baza_de_date.cpp:112:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:112:9: error: expected '(' before '}' token baza_de_date.cpp:112:9: error: expected primary-expression before '}' token baza_de_date.cpp:112:9: error: expected ')' before '}' token baza_de_date.cpp:112:9: error: expected ';' before '}' token baza_de_date.cpp:124:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:125:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:125:13: error: expected ';' before '}' token baza_de_date.cpp:126:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:126:9: error: expected '(' before '}' token baza_de_date.cpp:126:9: error: expected primary-expression before '}' token baza_de_date.cpp:126:9: error: expected ')' before '}' token baza_de_date.cpp:126:9: error: expected ';' before '}' token baza_de_date.cpp:133:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:134:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:134:13: error: expected ';' before '}' token baza_de_date.cpp:135:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:135:9: error: expected '(' before '}' token baza_de_date.cpp:135:9: error: expected primary-expression before '}' token baza_de_date.cpp:135:9: error: expected ')' before '}' token baza_de_date.cpp:135:9: error: expected ';' before '}' token baza_de_date.cpp:147:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:148:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:148:13: error: expected ';' before '}' token baza_de_date.cpp:149:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:149:9: error: expected '(' before '}' token baza_de_date.cpp:149:9: error: expected primary-expression before '}' token baza_de_date.cpp:149:9: error: expected ')' before '}' token baza_de_date.cpp:149:9: error: expected ';' before '}' token baza_de_date.cpp:156:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:157:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:157:13: error: expected ';' before '}' token baza_de_date.cpp:158:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:158:9: error: expected '(' before '}' token baza_de_date.cpp:158:9: error: expected primary-expression before '}' token baza_de_date.cpp:158:9: error: expected ')' before '}' token baza_de_date.cpp:158:9: error: expected ';' before '}' token baza_de_date.cpp:170:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:171:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:171:13: error: expected ';' before '}' token baza_de_date.cpp:172:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:172:9: error: expected '(' before '}' token baza_de_date.cpp:172:9: error: expected primary-expression before '}' token baza_de_date.cpp:172:9: error: expected ')' before '}' token baza_de_date.cpp:172:9: error: expected ';' before '}' token baza_de_date.cpp:179:27: error: expected primary-expression before ')' token while() ^ baza_de_date.cpp:180:13: error: expected primary-expression before '}' token } ^ baza_de_date.cpp:180:13: error: expected ';' before '}' token baza_de_date.cpp:181:9: error: expected 'while' before '}' token } ^ baza_de_date.cpp:181:9: error: expected '(' before '}' token baza_de_date.cpp:181:9: error: expected primary-expression before '}' token baza_de_date.cpp:181:9: error: expected ')' before '}' token baza_de_date.cpp:181:9: error: expected ';' before '}' token baza_de_date.cpp:12:10: warning: unused variable 'ok' [-Wunused-variable] bool ok; ^
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ă.