#2644
clase
Într-o școală sunt n
clase, fiecare având un număr diferit de elevi. Școală primește m
pachete cu cărți, fiecare cu un număr diferit de cărți. Pentru ca o clasa să primească un pachet, numărul elevilor din acea clasa trebuie să fie egal cu numărul cărților din pachet. Să se determine câte clase primesc un pachet de cărți.
Problema | clase | Operații I/O |
clase.in /clase.out
|
---|---|---|---|
Limita timp | 0.01 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
Id soluție | #52719374 | Utilizator | |
Fișier | clase.cpp | Dimensiune | 1.01 KB |
Data încărcării | 07 Octombrie 2024, 20:58 | Scor / rezultat | Eroare de compilare |
clase.cpp:4:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("clase.in"); ^ clase.cpp:5:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("clase.out"); ^ clase.cpp: In function 'bool cautare(long long int)': clase.cpp:15:5: error: reference to 'cout' is ambiguous cout<<"n="<<n<<"st="<<st<<"dr="<<dr<<endl; ^ clase.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("clase.out"); ^ In file included from clase.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ clase.cpp:20:9: error: reference to 'cout' is ambiguous cout<<"a[mij]="<<a[mij]<<" nr="<<nr<<endl; ^ clase.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("clase.out"); ^ In file included from clase.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ clase.cpp: In function 'int main()': clase.cpp:40:5: error: reference to 'cin' is ambiguous cin>>n; ^ clase.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("clase.in"); ^ In file included from clase.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ clase.cpp:43:9: error: reference to 'cin' is ambiguous cin>>a[i]; ^ clase.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("clase.in"); ^ In file included from clase.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ clase.cpp:45:5: error: reference to 'cin' is ambiguous cin>>m; ^ clase.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("clase.in"); ^ In file included from clase.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ clase.cpp:48:9: error: reference to 'cin' is ambiguous cin>>x; ^ clase.cpp:4:10: note: candidates are: <typeprefixerror>cin ifstream cin("clase.in"); ^ In file included from clase.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ clase.cpp:51:13: error: reference to 'cout' is ambiguous cout<<"cautare("<<x<<")= true"<< endl; ^ clase.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("clase.out"); ^ In file included from clase.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ clase.cpp:55:5: error: reference to 'cout' is ambiguous cout<<cnt; ^ clase.cpp:5:10: note: candidates are: <typeprefixerror>cout ofstream cout("clase.out"); ^ In file included from clase.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 clase 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ă.