#973
Cuvinte1
Se dă o propoziție care conține numai litere mici ale alfabetului englez și spații. Să se afișeze cuvintele din propoziție care conțin numai vocale.
Problema | Cuvinte1 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49808976 | Utilizator | |
Fișier | cuvinte1.cpp | Dimensiune | 438 B |
Data încărcării | 15 Martie 2024, 14:03 | Scor / rezultat | Eroare de compilare |
cuvinte1.cpp: In function 'int main()': cuvinte1.cpp:9:20: error: invalid conversion from 'signed char*' to 'std::basic_istream<char>::char_type* {aka char*}' [-fpermissive] cin.getline(s, 255); ^ In file included from /usr/include/c++/4.8/iostream:40:0, from cuvinte1.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) ^ cuvinte1.cpp:10:19: error: invalid conversion from 'signed char*' to 'char*' [-fpermissive] p = strtok(s, " "); ^ In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte1.cpp:4: /usr/include/string.h:348:14: error: initializing argument 1 of 'char* strtok(char*, const char*)' [-fpermissive] extern char *strtok (char *__restrict __s, const char *__restrict __delim) ^ cuvinte1.cpp:10:19: error: invalid conversion from 'char*' to 'signed char*' [-fpermissive] p = strtok(s, " "); ^ cuvinte1.cpp:12:28: error: invalid conversion from 'signed char*' to 'const char*' [-fpermissive] for (e = 1; e <= strlen(p); ++e) { ^ In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte1.cpp:4: /usr/include/string.h:399:15: error: initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive] extern size_t strlen (const char *__s) ^ cuvinte1.cpp:12:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (e = 1; e <= strlen(p); ++e) { ^ cuvinte1.cpp:13:22: error: call of overloaded 'strchr(signed char [6], signed char&)' is ambiguous if (strchr(a, p[e])) { ^ cuvinte1.cpp:13:22: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from cuvinte1.cpp:4: /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 'signed char [6]' 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 'signed char [6]' to 'const char*' cuvinte1.cpp:14:9: warning: unused variable 'ok' [-Wunused-variable] int ok=1; ^ cuvinte1.cpp:20:27: error: invalid conversion from 'char*' to 'signed char*' [-fpermissive] p=strtok(NULL, " "); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cuvinte1 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ă.