#3794
InterclasNoMemory1
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 | #35490966 | Utilizator | |
Fișier | interclasnomemory1.cpp | Dimensiune | 565 B |
Data încărcării | 11 Martie 2022, 09:26 | Scor / rezultat | Eroare de compilare |
interclasnomemory1.cpp:7:1: error: stray '\342' in program { ifstream f1(“file.in”); ifstream f2(“file.in”); int n, m; f1 >> n >> m; int x, y; f2 >> n >> m; for(int i = 0; i < n; i++) f2 >> x; ^ interclasnomemory1.cpp:7:1: error: stray '\200' in program interclasnomemory1.cpp:7:1: error: stray '\234' in program interclasnomemory1.cpp:7:1: error: stray '\342' in program interclasnomemory1.cpp:7:1: error: stray '\200' in program interclasnomemory1.cpp:7:1: error: stray '\235' in program interclasnomemory1.cpp:7:1: error: stray '\342' in program interclasnomemory1.cpp:7:1: error: stray '\200' in program interclasnomemory1.cpp:7:1: error: stray '\234' in program interclasnomemory1.cpp:7:1: error: stray '\342' in program interclasnomemory1.cpp:7:1: error: stray '\200' in program interclasnomemory1.cpp:7:1: error: stray '\235' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program ofstream g(“file.out”); int i = 0, j = 0; f1 >> x; f2 >> y; while(i < n && j < m) if(x < y) { g << x << ‘ ‘; i++; if(i < n) f1 >> x; } else { g << y << ‘ ‘; j++; if(j < m) f2 >> y; } while(i < n) { g << x << ‘ ‘; f1 >> x; i++; } while(j < m) { g << y << ‘ ‘; f2 >> y; j++; } f1.close(); f2.close(); g.close(); return 0; } ^ interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\234' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\235' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\230' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\230' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\230' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\230' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\230' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\230' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\230' in program interclasnomemory1.cpp:9:1: error: stray '\342' in program interclasnomemory1.cpp:9:1: error: stray '\200' in program interclasnomemory1.cpp:9:1: error: stray '\230' in program interclasnomemory1.cpp: In function 'int main()': interclasnomemory1.cpp:7:18: error: 'file' was not declared in this scope { ifstream f1(“file.in”); ifstream f2(“file.in”); int n, m; f1 >> n >> m; int x, y; f2 >> n >> m; for(int i = 0; i < n; i++) f2 >> x; ^ interclasnomemory1.cpp:9:116: error: expected primary-expression before ';' token ofstream g(“file.out”); int i = 0, j = 0; f1 >> x; f2 >> y; while(i < n && j < m) if(x < y) { g << x << ‘ ‘; i++; if(i < n) f1 >> x; } else { g << y << ‘ ‘; j++; if(j < m) f2 >> y; } while(i < n) { g << x << ‘ ‘; f1 >> x; i++; } while(j < m) { g << y << ‘ ‘; f2 >> y; j++; } f1.close(); f2.close(); g.close(); return 0; } ^ interclasnomemory1.cpp:9:168: error: expected primary-expression before ';' token ofstream g(“file.out”); int i = 0, j = 0; f1 >> x; f2 >> y; while(i < n && j < m) if(x < y) { g << x << ‘ ‘; i++; if(i < n) f1 >> x; } else { g << y << ‘ ‘; j++; if(j < m) f2 >> y; } while(i < n) { g << x << ‘ ‘; f1 >> x; i++; } while(j < m) { g << y << ‘ ‘; f2 >> y; j++; } f1.close(); f2.close(); g.close(); return 0; } ^ interclasnomemory1.cpp:9:228: error: expected primary-expression before ';' token ofstream g(“file.out”); int i = 0, j = 0; f1 >> x; f2 >> y; while(i < n && j < m) if(x < y) { g << x << ‘ ‘; i++; if(i < n) f1 >> x; } else { g << y << ‘ ‘; j++; if(j < m) f2 >> y; } while(i < n) { g << x << ‘ ‘; f1 >> x; i++; } while(j < m) { g << y << ‘ ‘; f2 >> y; j++; } f1.close(); f2.close(); g.close(); return 0; } ^ interclasnomemory1.cpp:9:278: error: expected primary-expression before ';' token ofstream g(“file.out”); int i = 0, j = 0; f1 >> x; f2 >> y; while(i < n && j < m) if(x < y) { g << x << ‘ ‘; i++; if(i < n) f1 >> x; } else { g << y << ‘ ‘; j++; if(j < m) f2 >> y; } while(i < n) { g << x << ‘ ‘; f1 >> x; i++; } while(j < m) { g << y << ‘ ‘; f2 >> y; j++; } f1.close(); f2.close(); g.close(); return 0; } ^
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ă.