#2563
FAdCresc
C++
Să se scrie o funcție C++ care inserează într-o listă simplu înlănțuită cu elementele ordonate crescător un nou nod care memorează valoarea x
astfel încât informațiile din lista să fie în continuare ordonate crescător.
Problema | FAdCresc | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #36600291 | Utilizator | |
Fișier | fadcresc.cpp | Dimensiune | 4.30 KB |
Data încărcării | 11 Mai 2022, 10:50 | Scor / rezultat | Eroare de compilare |
fadcresc.cpp:13:9: error: redefinition of 'struct nod' struct nod ^ fadcresc.cpp:4:8: error: previous definition of 'struct nod' struct nod{ ^ fadcresc.cpp: In function 'void creare(nod*&)': fadcresc.cpp:30:20: error: 'struct nod' has no member named 'nume' fin.getline(p->nume, 21); ^ fadcresc.cpp:31:20: error: 'struct nod' has no member named 'scoala' fin.getline(p->scoala, 21); ^ fadcresc.cpp:33:13: error: 'struct nod' has no member named 'clasa' fin>>p->clasa; ^ fadcresc.cpp:35:13: error: 'struct nod' has no member named 'punctaj' fin>>p->punctaj; ^ fadcresc.cpp: In function 'void maxim(nod*&)': fadcresc.cpp:60:15: error: 'struct nod' has no member named 'clasa' if(p->clasa==10) ^ fadcresc.cpp:63:26: error: 'struct nod' has no member named 'punctaj' if(maxim1<p->punctaj) maxim1=p->punctaj; ^ fadcresc.cpp:63:45: error: 'struct nod' has no member named 'punctaj' if(maxim1<p->punctaj) maxim1=p->punctaj; ^ fadcresc.cpp:72:19: error: 'struct nod' has no member named 'punctaj' if(p->punctaj==maxim1){ ^ fadcresc.cpp:73:26: error: 'struct nod' has no member named 'scoala' cout<<p->scoala; ^ fadcresc.cpp:54:10: warning: unused variable 'n' [-Wunused-variable] int n; ^ fadcresc.cpp: In function 'void afisare(nod*)': fadcresc.cpp:82:15: error: 'struct nod' has no member named 'nume' { cout<<p->nume<<" "<<p->scoala<<" "<<p->clasa<<" "<<p->punctaj; ^ fadcresc.cpp:82:29: error: 'struct nod' has no member named 'scoala' { cout<<p->nume<<" "<<p->scoala<<" "<<p->clasa<<" "<<p->punctaj; ^ fadcresc.cpp:82:45: error: 'struct nod' has no member named 'clasa' { cout<<p->nume<<" "<<p->scoala<<" "<<p->clasa<<" "<<p->punctaj; ^ fadcresc.cpp:82:60: error: 'struct nod' has no member named 'punctaj' { cout<<p->nume<<" "<<p->scoala<<" "<<p->clasa<<" "<<p->punctaj; ^ fadcresc.cpp: In function 'void afisare1(nod*)': fadcresc.cpp:99:27: error: 'struct nod' has no member named 'scoala' if(strcmp(scuala, p->scoala)==0) ^ fadcresc.cpp:103:18: error: 'struct nod' has no member named 'nume' cout<<p->nume<<" "<<p->scoala<<" "<<p->clasa<<" "<<p->punctaj; ^ fadcresc.cpp:103:32: error: 'struct nod' has no member named 'scoala' cout<<p->nume<<" "<<p->scoala<<" "<<p->clasa<<" "<<p->punctaj; ^ fadcresc.cpp:103:48: error: 'struct nod' has no member named 'clasa' cout<<p->nume<<" "<<p->scoala<<" "<<p->clasa<<" "<<p->punctaj; ^ fadcresc.cpp:103:63: error: 'struct nod' has no member named 'punctaj' cout<<p->nume<<" "<<p->scoala<<" "<<p->clasa<<" "<<p->punctaj; ^ fadcresc.cpp: In function 'void medie(nod*&)': fadcresc.cpp:119:15: error: 'struct nod' has no member named 'clasa' if(p->clasa==12) ^ fadcresc.cpp:121:20: error: 'struct nod' has no member named 'punctaj' s=s+p->punctaj; ^ fadcresc.cpp:132:17: error: 'struct nod' has no member named 'punctaj' if(medie<p->punctaj && p->clasa==12) ^ fadcresc.cpp:132:31: error: 'struct nod' has no member named 'clasa' if(medie<p->punctaj && p->clasa==12) ^ fadcresc.cpp: In function 'void inserare(nod*&)': fadcresc.cpp:146:16: error: 'struct nod' has no member named 'nume' cin.getline(p->nume, 21); ^ fadcresc.cpp:147:16: error: 'struct nod' has no member named 'scoala' cin.getline(p->scoala, 21); ^ fadcresc.cpp:148:9: error: 'struct nod' has no member named 'clasa' cin>>p->clasa; ^ fadcresc.cpp:150:9: error: 'struct nod' has no member named 'punctaj' cin>>p->punctaj; ^ fadcresc.cpp:140:10: warning: unused variable 'q' [-Wunused-variable] nod *p, *q; ^ fadcresc.cpp: In function 'void stergere(nod*&)': fadcresc.cpp:162:16: error: 'struct nod' has no member named 'punctaj' if(p->urm->punctaj==0){ ^ fadcresc.cpp:170:15: error: 'struct nod' has no member named 'punctaj' if(prim->punctaj==0) ^ fadcresc.cpp: In function 'void vocale(nod*&)': fadcresc.cpp:183:34: error: 'struct nod' has no member named 'nume' for(int i=0; i<strlen(p->nume); i++){ ^ fadcresc.cpp:184:32: error: 'struct nod' has no member named 'nume' if(strchr("aeiouAEIOU", p->nume[i])!=0) ^ fadcresc.cpp:190:18: error: 'struct nod' has no member named 'nume' cout<<p->nume; ^ fadcresc.cpp: In function 'void media(nod*&)': fadcresc.cpp:205:11: error: 'struct nod' has no member named 'clasa' if(p->clasa==5){ ^ fadcresc.cpp:206:18: error: 'struct nod' has no member named 'punctaj' s5=s5+p->punctaj; ^ fadcresc.cpp:210:11: error: 'struct nod' has no member named 'clasa' if(p->clasa==6){ ^ fadcresc.cpp:211:18: error: 'struct nod' has no member named 'punctaj' s6=s6+p->punctaj; ^ fadcresc.cpp:216:11: error: 'struct nod' has no member named 'clasa' if(p->clasa==7){ ^ fadcresc.cpp:217:18: error: 'struct nod' has no member named 'punctaj' s7=s7+p->punctaj; ^ fadcresc.cpp:221:11: error: 'struct nod' has no member named 'clasa' if(p->clasa==8){ ^ fadcresc.cpp:222:18: error: 'struct nod' has no member named 'punctaj' s8=s8+p->punctaj; ^ fadcresc.cpp:227:11: error: 'struct nod' has no member named 'clasa' if(p->clasa==9){ ^ fadcresc.cpp:228:18: error: 'struct nod' has no member named 'punctaj' s9=s9+p->punctaj; ^ fadcresc.cpp:232:11: error: 'struct nod' has no member named 'clasa' if(p->clasa==10){ ^ fadcresc.cpp:233:20: error: 'struct nod' has no member named 'punctaj' s10=s10+p->punctaj; ^ fadcresc.cpp:237:11: error: 'struct nod' has no member named 'clasa' if(p->clasa==11){ ^ fadcresc.cpp:238:20: error: 'struct nod' has no member named 'punctaj' s11=s11+p->punctaj; ^ fadcresc.cpp:242:11: error: 'struct nod' has no member named 'clasa' if(p->clasa==12){ ^ fadcresc.cpp:243:20: error: 'struct nod' has no member named 'punctaj' s12=s12+p->punctaj; ^ fadcresc.cpp: In function 'void afisare(nod*)': fadcresc.cpp:286:6: error: redefinition of 'void afisare(nod*)' void afisare(nod * p) ^ fadcresc.cpp:78:7: error: 'void afisare(nod*)' previously defined here void afisare(nod*prim) ^ fadcresc.cpp: In function 'int main()': fadcresc.cpp:318:5: error: redefinition of 'int main()' int main() ^ fadcresc.cpp:262:5: error: 'int main()' previously defined here int main() ^ fadcresc.cpp:329:19: error: 'ins_cresc' was not declared in this scope ins_cresc(p, x); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FAdCresc face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. 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ă.