#972
Pozitii
Se dă un șir de caractere. Să se determine câte vocale din șir sunt cuprinse între două consoane.
Problema | Pozitii | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53847460 | Utilizator | |
Fișier | pozitii.cpp | Dimensiune | 382 B |
Data încărcării | 13 Noiembrie 2024, 09:20 | Scor / rezultat | Eroare de compilare |
pozitii.cpp: In function 'int main()': pozitii.cpp:9:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=1;i<strlen(s)-1;i++){ ^ pozitii.cpp:11:31: error: call of overloaded 'strstr(char&, const char [6])' is ambiguous if(strstr(s[i],"aeiou")==0)ok=0; ^ pozitii.cpp:11:31: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.cpp:2: /usr/include/string.h:329:1: note: char* strstr(char*, const char*) <near match> strstr (char *__haystack, const char *__needle) __THROW ^ /usr/include/string.h:329:1: note: no known conversion for argument 1 from 'char' to 'char*' /usr/include/string.h:335:1: note: const char* strstr(const char*, const char*) <near match> strstr (const char *__haystack, const char *__needle) __THROW ^ /usr/include/string.h:335:1: note: no known conversion for argument 1 from 'char' to 'const char*' pozitii.cpp:12:33: error: call of overloaded 'strstr(char&, const char [6])' is ambiguous if(strstr(s[i-1],"aeiou")!=0)ok=0; ^ pozitii.cpp:12:33: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.cpp:2: /usr/include/string.h:329:1: note: char* strstr(char*, const char*) <near match> strstr (char *__haystack, const char *__needle) __THROW ^ /usr/include/string.h:329:1: note: no known conversion for argument 1 from 'char' to 'char*' /usr/include/string.h:335:1: note: const char* strstr(const char*, const char*) <near match> strstr (const char *__haystack, const char *__needle) __THROW ^ /usr/include/string.h:335:1: note: no known conversion for argument 1 from 'char' to 'const char*' pozitii.cpp:13:33: error: call of overloaded 'strstr(char&, const char [6])' is ambiguous if(strstr(s[i+1],"aeiou")!=0)ok=0; ^ pozitii.cpp:13:33: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.cpp:2: /usr/include/string.h:329:1: note: char* strstr(char*, const char*) <near match> strstr (char *__haystack, const char *__needle) __THROW ^ /usr/include/string.h:329:1: note: no known conversion for argument 1 from 'char' to 'char*' /usr/include/string.h:335:1: note: const char* strstr(const char*, const char*) <near match> strstr (const char *__haystack, const char *__needle) __THROW ^ /usr/include/string.h:335:1: note: no known conversion for argument 1 from 'char' to 'const char*'
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Pozitii 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ă.