#904
Să se scrie o funcție C++ care primește doi parametri a și b și returnează numărul obținut prin concatenarea lui a cu b.
| Problema | Concat | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64402099 | Utilizator | |
| Fișier | concat.cpp | Dimensiune | 582 B |
| Data încărcării | 05 Mai 2026, 11:49 | Scor/rezultat | Eroare de compilare |
concat.cpp: In function ‘int main()’: concat.cpp:6:44: error: a function-definition is not allowed here before ‘{’ token 6 | long long concat(long long a, long long b) { | ^ concat.cpp:26:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 26 | int main() { | ^~ concat.cpp:26:9: note: remove parentheses to default-initialize a variable 26 | int main() { | ^~ | -- concat.cpp:26:9: note: or replace parentheses with braces to value-initialize a variable concat.cpp:26:12: error: a function-definition is not allowed here before ‘{’ token 26 | int main() { | ^ concat.cpp:32:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 32 | int main(){ | ^~ concat.cpp:32:9: note: remove parentheses to default-initialize a variable 32 | int main(){ | ^~ | -- concat.cpp:32:9: note: or replace parentheses with braces to value-initialize a variable concat.cpp:32:11: error: a function-definition is not allowed here before ‘{’ token 32 | int main(){ | ^ concat.cpp:37:2: error: expected ‘}’ at end of input 37 | } | ^ concat.cpp:5:11: note: to match this ‘{’ 5 | int main(){ | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Concat 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ă.