#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 | #54482795 | Utilizator | |
Fișier | pozitii.cpp | Dimensiune | 465 B |
Data încărcării | 29 Noiembrie 2024, 17:47 | Scor / rezultat | Eroare de compilare |
pozitii.cpp: In function 'int v(char)': pozitii.cpp:6:17: error: invalid conversion from 'const char*' to 'char' [-fpermissive] char vocale="aeiou"; ^ pozitii.cpp:7:23: error: call of overloaded 'strchr(char&, char&)' is ambiguous if(strchr(vocale,c)!=0)return 1; ^ pozitii.cpp:7:23: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.cpp:2: /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: In function 'int c(char)': pozitii.cpp:12:19: error: invalid conversion from 'const char*' to 'char' [-fpermissive] char consoane="bcdfghjklmnpqrstvwxyz"; ^ pozitii.cpp:13:25: error: call of overloaded 'strchr(char&, char&)' is ambiguous if(strchr(consoane,c)!=0)return 1; ^ pozitii.cpp:13:25: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.cpp:2: /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: In function 'int main()': pozitii.cpp:20:22: error: invalid conversion from 'int' to 'std::basic_istream<char>::char_type* {aka char*}' [-fpermissive] cin.getline(260,a); ^ In file included from /usr/include/c++/4.8/iostream:40:0, from pozitii.cpp:1: /usr/include/c++/4.8/istream:427:7: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int]' [-fpermissive] getline(char_type* __s, streamsize __n) ^ pozitii.cpp:20:22: error: invalid conversion from 'char*' to 'std::streamsize {aka int}' [-fpermissive] cin.getline(260,a); ^ In file included from /usr/include/c++/4.8/iostream:40:0, from pozitii.cpp:1: /usr/include/c++/4.8/istream:427:7: error: initializing argument 2 of 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::getline(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = int]' [-fpermissive] getline(char_type* __s, streamsize __n) ^ pozitii.cpp:21:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=1;i<strlen(a);i++) ^ pozitii.cpp:22:25: error: 'c' cannot be used as a function if(v(a[i])&&c(a[i-1])&&c(a[i+1]))c++; ^ pozitii.cpp:22:36: error: 'c' cannot be used as a function if(v(a[i])&&c(a[i-1])&&c(a[i+1]))c++; ^
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ă.