#4270
Să se scrie o funcție care concatenează un șir de caracterele cu un alt șir.
| Problema | FConcat | Operații I/O |
fconcat.in/fconcat.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64758000 | Utilizator | |
| Fișier | fconcat.cpp | Dimensiune | 597 B |
| Data încărcării | 28 Mai 2026, 10:18 | Scor/rezultat | Eroare de compilare |
fconcat.cpp: In function ‘void Prescurtat(char*)’: fconcat.cpp:8:7: error: ‘strtok’ was not declared in this scope; did you mean ‘strtoq’? 8 | p=strtok(s,sep); | ^~~~~~ | strtoq fconcat.cpp:11:9: error: ‘strcpy’ was not declared in this scope 11 | strcpy(cuv[++j],p); | ^~~~~~ fconcat.cpp:2:1: note: ‘strcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? 1 | #include <fstream> +++ |+#include <cstring> 2 | using namespace std; fconcat.cpp:17:19: error: ‘strlen’ was not declared in this scope 17 | if(cuv[i][strlen(cuv[i])-1]=='.') | ^~~~~~ fconcat.cpp:17:19: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? fconcat.cpp:18:29: error: ‘strcpy’ was not declared in this scope 18 | {if(cuv[i][0]=='C') strcpy(cuv[i],"COLEGIUL"); | ^~~~~~ fconcat.cpp:18:29: note: ‘strcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? fconcat.cpp:19:28: error: ‘strcpy’ was not declared in this scope 19 | if(cuv[i][0]=='L') strcpy(cuv[i],"LICEUL"); | ^~~~~~ fconcat.cpp:19:28: note: ‘strcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? fconcat.cpp:20:28: error: ‘strcpy’ was not declared in this scope 20 | if(cuv[i][0]=='N') strcpy(cuv[i],"NATIONAL"); | ^~~~~~ fconcat.cpp:20:28: note: ‘strcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? fconcat.cpp:21:29: error: ‘strcpy’ was not declared in this scope 21 | if(cuv[i][0]=='T') strcpy(cuv[i],"TEORETIC");} | ^~~~~~ fconcat.cpp:21:29: note: ‘strcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? fconcat.cpp:22:9: error: ‘strcat’ was not declared in this scope 22 | strcat(s,cuv[i]); | ^~~~~~ fconcat.cpp:22:9: note: ‘strcat’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? fconcat.cpp:25:14: error: ‘strlen’ was not declared in this scope 25 | strcpy(s+strlen(s)-1,s+strlen(s)); | ^~~~~~ fconcat.cpp:25:14: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? fconcat.cpp:25:5: error: ‘strcpy’ was not declared in this scope 25 | strcpy(s+strlen(s)-1,s+strlen(s)); | ^~~~~~ fconcat.cpp:25:5: note: ‘strcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? fconcat.cpp: In function ‘int main()’: fconcat.cpp:37:5: error: ‘FConcat’ was not declared in this scope 37 | FConcat(s, d); | ^~~~~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema FConcat 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ă.