#2730
SC
C++
Scrieți funcția recursivă având următorul antet:
int SC(char s[])
Funcția primește ca parametru un șir de caractere și returnează suma tuturor cifrelor care apar în șir.
Problema | SC | Operații I/O |
sc.in /sc.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #33410372 | Utilizator | |
Fișier | sc.cpp | Dimensiune | 355 B |
Data încărcării | 17 Decembrie 2021, 16:47 | Scor / rezultat | Eroare de compilare |
sc.cpp:6:1: error: 'include' does not name a type include <iostream> ^ In file included from sc.cpp:8:0: /usr/include/c++/4.8/cstring:75:11: error: '::memchr' has not been declared using ::memchr; ^ /usr/include/c++/4.8/cstring:76:11: error: '::memcmp' has not been declared using ::memcmp; ^ /usr/include/c++/4.8/cstring:77:11: error: '::memcpy' has not been declared using ::memcpy; ^ /usr/include/c++/4.8/cstring:78:11: error: '::memmove' has not been declared using ::memmove; ^ /usr/include/c++/4.8/cstring:79:11: error: '::memset' has not been declared using ::memset; ^ /usr/include/c++/4.8/cstring:80:11: error: '::strcat' has not been declared using ::strcat; ^ /usr/include/c++/4.8/cstring:81:11: error: '::strcmp' has not been declared using ::strcmp; ^ /usr/include/c++/4.8/cstring:82:11: error: '::strcoll' has not been declared using ::strcoll; ^ /usr/include/c++/4.8/cstring:83:11: error: '::strcpy' has not been declared using ::strcpy; ^ /usr/include/c++/4.8/cstring:84:11: error: '::strcspn' has not been declared using ::strcspn; ^ /usr/include/c++/4.8/cstring:85:11: error: '::strerror' has not been declared using ::strerror; ^ /usr/include/c++/4.8/cstring:86:11: error: '::strlen' has not been declared using ::strlen; ^ /usr/include/c++/4.8/cstring:87:11: error: '::strncat' has not been declared using ::strncat; ^ /usr/include/c++/4.8/cstring:88:11: error: '::strncmp' has not been declared using ::strncmp; ^ /usr/include/c++/4.8/cstring:89:11: error: '::strncpy' has not been declared using ::strncpy; ^ /usr/include/c++/4.8/cstring:90:11: error: '::strspn' has not been declared using ::strspn; ^ /usr/include/c++/4.8/cstring:91:11: error: '::strtok' has not been declared using ::strtok; ^ /usr/include/c++/4.8/cstring:92:11: error: '::strxfrm' has not been declared using ::strxfrm; ^ /usr/include/c++/4.8/cstring:93:11: error: '::strchr' has not been declared using ::strchr; ^ /usr/include/c++/4.8/cstring:94:11: error: '::strpbrk' has not been declared using ::strpbrk; ^ /usr/include/c++/4.8/cstring:95:11: error: '::strrchr' has not been declared using ::strrchr; ^ /usr/include/c++/4.8/cstring:96:11: error: '::strstr' has not been declared using ::strstr; ^ sc.cpp: In function 'int SC(char*)': sc.cpp:15:16: error: 'strlen' was not declared in this scope if(strlen(s) == 0) ^ sc.cpp:23:3: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SC 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ă.