#3794
Se dau două șiruri de numere naturale, cu n, respectiv m elemente, ordonate crescător. Să se determine al treilea șir, care să conţină, în ordine crescătoare, elementele din primele două şiruri.
| Problema | InterclasNoMemory1 | Operații I/O |
file.in/file.out
|
|---|---|---|---|
| Limita timp | 0.25 secunde | Limita memorie |
Total: 0.1 MB
/
Stivă 0.1 MB
|
| Id soluție | #64783217 | Utilizator | |
| Fișier | interclasnomemory1.cpp | Dimensiune | 713 B |
| Data încărcării | 30 Mai 2026, 17:55 | Scor/rezultat | Eroare de compilare |
interclasnomemory1.cpp: In function ‘void interclasare()’: interclasnomemory1.cpp:11:9: error: ‘ifstream’ was not declared in this scope; did you mean ‘std::ifstream’? 11 | ifstream fin1("file1.txt"); | ^~~~~~~~ | std::ifstream In file included from /usr/include/c++/13/ios:40, from /usr/include/c++/13/istream:40, from /usr/include/c++/13/fstream:40, from interclasnomemory1.cpp:2: /usr/include/c++/13/iosfwd:164:41: note: ‘std::ifstream’ declared here 164 | typedef basic_ifstream<char> ifstream; | ^~~~~~~~ interclasnomemory1.cpp:12:17: error: expected ‘;’ before ‘fin2’ 12 | ifstream fin2("file2.txt"); | ^~~~~ | ; interclasnomemory1.cpp:13:9: error: ‘ofstream’ was not declared in this scope; did you mean ‘std::ofstream’? 13 | ofstream fout("file.out"); | ^~~~~~~~ | std::ofstream /usr/include/c++/13/iosfwd:167:41: note: ‘std::ofstream’ declared here 167 | typedef basic_ofstream<char> ofstream; | ^~~~~~~~ interclasnomemory1.cpp:15:9: error: ‘fin1’ was not declared in this scope; did you mean ‘n1’? 15 | fin1 >> n1; | ^~~~ | n1 interclasnomemory1.cpp:16:9: error: ‘fin2’ was not declared in this scope; did you mean ‘n2’? 16 | fin2 >> n2; | ^~~~ | n2 interclasnomemory1.cpp:28:25: error: ‘fout’ was not declared in this scope 28 | fout << var1 << ' '; | ^~~~ interclasnomemory1.cpp:34:25: error: ‘fout’ was not declared in this scope 34 | fout << var2 << ' '; | ^~~~ interclasnomemory1.cpp:42:17: error: ‘fout’ was not declared in this scope 42 | fout << var1 << ' '; | ^~~~ interclasnomemory1.cpp:48:17: error: ‘fout’ was not declared in this scope 48 | fout << var2 << ' '; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InterclasNoMemory1 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ă.