#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 |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50486621 | Utilizator | |
Fișier | pozitii.cpp | Dimensiune | 316 B |
Data încărcării | 11 Aprilie 2024, 11:31 | Scor / rezultat | Eroare de compilare |
pozitii.cpp: In function 'int main()': pozitii.cpp:9:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=1;i<=strlen(s)-2;i++) ^ pozitii.cpp:10:28: error: call of overloaded 'strchr(char&, char [6])' is ambiguous if(strchr(s[i], voc)==0 && strchr(s[i-1], voc)!=0 && strchr(s[i+1], voc)!=0) ct++; ^ pozitii.cpp:10:28: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from pozitii.cpp:1: /usr/include/string.h:223:1: note: char* strchr(char*, int) <near match> strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 2 from 'char [6]' to 'int' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) <near match> strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 2 from 'char [6]' to 'int' pozitii.cpp:10:54: error: call of overloaded 'strchr(char&, char [6])' is ambiguous if(strchr(s[i], voc)==0 && strchr(s[i-1], voc)!=0 && strchr(s[i+1], voc)!=0) ct++; ^ pozitii.cpp:10:54: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from pozitii.cpp:1: /usr/include/string.h:223:1: note: char* strchr(char*, int) <near match> strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 2 from 'char [6]' to 'int' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) <near match> strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 2 from 'char [6]' to 'int' pozitii.cpp:10:80: error: call of overloaded 'strchr(char&, char [6])' is ambiguous if(strchr(s[i], voc)==0 && strchr(s[i-1], voc)!=0 && strchr(s[i+1], voc)!=0) ct++; ^ pozitii.cpp:10:80: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from pozitii.cpp:1: /usr/include/string.h:223:1: note: char* strchr(char*, int) <near match> strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: no known conversion for argument 2 from 'char [6]' to 'int' /usr/include/string.h:229:1: note: const char* strchr(const char*, int) <near match> strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: no known conversion for argument 2 from 'char [6]' to 'int'
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ă.