#85
InserareAsterisc
Să se scrie un program care citește un text și inserează după fiecare vocală caracterul *
.
Problema | InserareAsterisc | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #52952665 | Utilizator | |
Fișier | inserareasterisc.cpp | Dimensiune | 355 B |
Data încărcării | 14 Octombrie 2024, 09:39 | Scor / rezultat | Eroare de compilare |
inserareasterisc.cpp: In function 'int main()': inserareasterisc.cpp:10:19: error: invalid conversion from 'char' to 'std::basic_istream<char>::char_type* {aka char*}' [-fpermissive] cin.getline(s, 201); ^ In file included from /usr/include/c++/4.8/iostream:40:0, from inserareasterisc.cpp:2: /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) ^ inserareasterisc.cpp:11:23: error: invalid conversion from 'char' to 'const char*' [-fpermissive] for(i=0;i<strlen(s);i++) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from inserareasterisc.cpp:1: /usr/include/string.h:399:15: error: initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive] extern size_t strlen (const char *__s) ^ inserareasterisc.cpp:11:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0;i<strlen(s);i++) ^ inserareasterisc.cpp:12:24: error: invalid types 'char[int]' for array subscript if(strchr("aeiou",s[i])) ^ inserareasterisc.cpp:14:21: error: invalid conversion from 'int' to 'const char*' [-fpermissive] strcpy(aux, s+i+1) ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/cstring:41, from inserareasterisc.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:102:1: error: initializing argument 2 of 'char* strcpy(char*, const char*)' [-fpermissive] __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) ^ inserareasterisc.cpp:15:10: error: expected ';' before 's' s[i+1]='*'; ^ inserareasterisc.cpp:16:16: error: invalid conversion from 'int' to 'char*' [-fpermissive] strcpy(s+i+2, aux);} ^ In file included from /usr/include/features.h:374:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/os_defines.h:39, from /usr/include/i386-linux-gnu/c++/4.8/bits/c++config.h:426, from /usr/include/c++/4.8/cstring:41, from inserareasterisc.cpp:1: /usr/include/i386-linux-gnu/bits/string3.h:102:1: error: initializing argument 1 of 'char* strcpy(char*, const char*)' [-fpermissive] __NTH (strcpy (char *__restrict __dest, const char *__restrict __src)) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InserareAsterisc 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ă.