#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 | #54782148 | Utilizator | |
Fișier | pozitii.cpp | Dimensiune | 359 B |
Data încărcării | 08 Decembrie 2024, 17:21 | Scor / rezultat | Eroare de compilare |
pozitii.cpp:4:21: error: invalid conversion from 'const char*' to 'char' [-fpermissive] char s[256], vocale="aeiou"; ^ pozitii.cpp:5:15: error: invalid conversion from 'const char*' to 'char' [-fpermissive] char consoane="bcdfghjklmnpqrstvwxyz"; ^ pozitii.cpp: In function 'int main()': pozitii.cpp:10:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<strlen (s);i++) ^ pozitii.cpp:12:30: error: call of overloaded 'strchr(char&, char&)' is ambiguous if(strchr(vocale,s[i]) && strchr(consoane,s[i-1]) && strchr (consoane, s[i+1])) ^ pozitii.cpp:12:30: 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 1 from 'char' to 'char*' /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 1 from 'char' to 'const char*' pozitii.cpp:12:57: error: call of overloaded 'strchr(char&, char&)' is ambiguous if(strchr(vocale,s[i]) && strchr(consoane,s[i-1]) && strchr (consoane, s[i+1])) ^ pozitii.cpp:12:57: 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 1 from 'char' to 'char*' /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 1 from 'char' to 'const char*' pozitii.cpp:12:86: error: call of overloaded 'strchr(char&, char&)' is ambiguous if(strchr(vocale,s[i]) && strchr(consoane,s[i-1]) && strchr (consoane, s[i+1])) ^ pozitii.cpp:12:86: 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 1 from 'char' to 'char*' /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 1 from 'char' to 'const char*' pozitii.cpp:13:13: error: 'nr' was not declared in this scope nr++; ^ pozitii.cpp:15:11: error: 'nr' was not declared in this scope cout<<nr; ^
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ă.