#3243
Path
C++
Scrieți funcția cu următorul antet:
int Path(const char cale[], char d[101][101])
Parametrul cale
memorează un șir de caractere format din litere mici și semnul \
și reprezintă o succesiune de foldere incluse unul în altul. Funcția trebuie să memoreze fiecare folder pe câte o linie a matricei d
și să returneze numărul de foldere conținute în cale
.
Problema | Path | Operații I/O |
path.in /path.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 2 MB
/
Stivă 1 MB
|
Id soluție | #24176485 | Utilizator | |
Fișier | path.cpp | Dimensiune | 612 B |
Data încărcării | 29 Septembrie 2020, 21:26 | Scor / rezultat | Eroare de compilare |
path.cpp: In function 'void Prescurtat(char*)': path.cpp:15:20: error: 'strtok' was not declared in this scope p=strtok(s,sep); w[0]='\0'; ^ path.cpp:21:18: error: 'strlen' was not declared in this scope n=strlen(p); ^ path.cpp:23:35: error: 'strcat' was not declared in this scope if (p[n-1]!='.') strcat(w,p); ^ path.cpp:31:27: error: 'strstr' was not declared in this scope if (strstr(c1,p)) strcat(w,c1); ^ path.cpp:31:41: error: 'strcat' was not declared in this scope if (strstr(c1,p)) strcat(w,c1); ^ path.cpp:33:27: error: 'strstr' was not declared in this scope if (strstr(c2,p)) strcat(w,c2); ^ path.cpp:33:41: error: 'strcat' was not declared in this scope if (strstr(c2,p)) strcat(w,c2); ^ path.cpp:35:27: error: 'strstr' was not declared in this scope if (strstr(c3,p)) strcat(w,c3); ^ path.cpp:35:41: error: 'strcat' was not declared in this scope if (strstr(c3,p)) strcat(w,c3); ^ path.cpp:37:27: error: 'strstr' was not declared in this scope if (strstr(c4,p)) strcat(w,c4); ^ path.cpp:37:41: error: 'strcat' was not declared in this scope if (strstr(c4,p)) strcat(w,c4); ^ path.cpp:43:28: error: 'strcat' was not declared in this scope if (p) strcat(w, " "); ^ path.cpp:47:14: error: 'strcpy' was not declared in this scope strcpy(s,w); ^ path.cpp: In function 'int main()': path.cpp:56:25: error: 'Path' was not declared in this scope int n = Path(cale, d); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Path 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ă.