#1172
FListaNumarare
C++
Să se scrie o funcție C++ care determină câte elemente sunt memorate într-o lista simplu înlănțuită.
Problema | FListaNumarare | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50870069 | Utilizator | |
Fișier | flistanumarare.cpp | Dimensiune | 761 B |
Data încărcării | 11 Mai 2024, 10:42 | Scor / rezultat | Eroare de compilare |
flistanumarare.cpp:33:8: error: redefinition of 'struct nod' struct nod{ ^ flistanumarare.cpp:4:8: error: previous definition of 'struct nod' struct nod{ ^ flistanumarare.cpp: In function 'int main()': flistanumarare.cpp:72:11: error: reference to 'cin' is ambiguous while(cin>>nr) ^ flistanumarare.cpp:31:10: note: candidates are: std::ifstream cin ifstream cin ("date.in"); ^ In file included from flistanumarare.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ flistanumarare.cpp:74:6: error: reference to 'cout' is ambiguous cout << numarare(prim); ^ flistanumarare.cpp:32:10: note: candidates are: std::ofstream cout ofstream cout ("date.out"); ^ In file included from flistanumarare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ flistanumarare.cpp: In function 'void afisare(nod*, int)': flistanumarare.cpp:83:4: error: reference to 'cout' is ambiguous cout << p -> info << " "; ^ flistanumarare.cpp:32:10: note: candidates are: std::ofstream cout ofstream cout ("date.out"); ^ In file included from flistanumarare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ flistanumarare.cpp:86:2: error: reference to 'cout' is ambiguous cout << endl; ^ flistanumarare.cpp:32:10: note: candidates are: std::ofstream cout ofstream cout ("date.out"); ^ In file included from flistanumarare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ flistanumarare.cpp: In function 'int main()': flistanumarare.cpp:99:5: error: redefinition of 'int main()' int main() ^ flistanumarare.cpp:69:5: error: 'int main()' previously defined here int main() ^ flistanumarare.cpp:103:8: error: reference to 'cin' is ambiguous while(cin >> x) ^ flistanumarare.cpp:31:10: note: candidates are: std::ifstream cin ifstream cin ("date.in"); ^ In file included from flistanumarare.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ flistanumarare.cpp:105:2: error: reference to 'cout' is ambiguous cout << numarare(p); ^ flistanumarare.cpp:32:10: note: candidates are: std::ofstream cout ofstream cout ("date.out"); ^ In file included from flistanumarare.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FListaNumarare 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ă.