#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 | #48239296 | Utilizator | |
Fișier | pozitii.cpp | Dimensiune | 349 B |
Data încărcării | 19 Ianuarie 2024, 11:17 | Scor / rezultat | Eroare de compilare |
pozitii.cpp:4:11: warning: overflow in implicit constant conversion [-Woverflow] char s(256); ^ pozitii.cpp: In function 'int main()': pozitii.cpp:8:22: error: invalid conversion from 'char' to 'std::basic_istream<char>::char_type* {aka char*}' [-fpermissive] cin.getline(s,256); ^ 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:9:15: error: invalid conversion from 'char' to 'const char*' [-fpermissive] n=strlen(s); ^ In file included from /usr/include/c++/4.8/cstring:42:0, from pozitii.cpp:2: /usr/include/string.h:399:15: error: initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive] extern size_t strlen (const char *__s) ^ pozitii.cpp:10:9: error: 'i' was not declared in this scope for(i=1;i<n;i++) ^ pozitii.cpp:11:27: error: expected ')' before 's' if(strchr("aeiou" s[i]) && strchr("qwrtypsdfghjklzxcvbnm" s[i-1] && strchr("qwrtypsdfghjklzxcvbnm" s[i+1])) ^ pozitii.cpp:11:31: error: no matching function for call to 'strchr(const char [6])' if(strchr("aeiou" s[i]) && strchr("qwrtypsdfghjklzxcvbnm" s[i-1] && strchr("qwrtypsdfghjklzxcvbnm" s[i+1])) ^ 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:223:1: note: char* strchr(char*, int) strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: candidate expects 2 arguments, 1 provided /usr/include/string.h:229:1: note: const char* strchr(const char*, int) strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: candidate expects 2 arguments, 1 provided pozitii.cpp:11:67: error: expected ')' before 's' if(strchr("aeiou" s[i]) && strchr("qwrtypsdfghjklzxcvbnm" s[i-1] && strchr("qwrtypsdfghjklzxcvbnm" s[i+1])) ^ pozitii.cpp:11:115: error: no matching function for call to 'strchr(const char [22])' if(strchr("aeiou" s[i]) && strchr("qwrtypsdfghjklzxcvbnm" s[i-1] && strchr("qwrtypsdfghjklzxcvbnm" s[i+1])) ^ pozitii.cpp:11:115: 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) strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: candidate expects 2 arguments, 1 provided /usr/include/string.h:229:1: note: const char* strchr(const char*, int) strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: candidate expects 2 arguments, 1 provided pozitii.cpp:12:12: error: expected ')' before 'cnt' cnt++; ^
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ă.