Să se scrie un program care citește un cuvânt și îl afișează după interschimbarea primei vocale cu ultima consoană.
Problema | InterschimbareLitere | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54012498 | Utilizator | |
Fișier | interschimbarelitere.cpp | Dimensiune | 620 B |
Data încărcării | 17 Noiembrie 2024, 20:46 | Scor / rezultat | Eroare de compilare |
interschimbarelitere.cpp: In function 'int main()': interschimbarelitere.cpp:7:15: warning: overflow in implicit constant conversion [-Woverflow] char s(256); ^ interschimbarelitere.cpp:10:18: error: invalid conversion from 'char' to 'std::basic_istream<char>::char_type* {aka char*}' [-fpermissive] cin.get(s,256); ^ In file included from /usr/include/c++/4.8/iostream:40:0, from interschimbarelitere.cpp:2: /usr/include/c++/4.8/istream:354:7: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::get(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] get(char_type* __s, streamsize __n) ^ interschimbarelitere.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 interschimbarelitere.cpp:3: /usr/include/string.h:399:15: error: initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive] extern size_t strlen (const char *__s) ^ interschimbarelitere.cpp:11:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0;i<strlen(s);i++) ^ interschimbarelitere.cpp:14:35: error: invalid types 'char[int]' for array subscript if(strchr("aeiouAEIOU",s[i])==0) ^ interschimbarelitere.cpp:17:23: error: invalid types 'char[int]' for array subscript vocala=s[i]; ^ interschimbarelitere.cpp:21:19: error: invalid conversion from 'char' to 'const char*' [-fpermissive] for(j=strlen(s)-1;j>=0;j--) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from interschimbarelitere.cpp:3: /usr/include/string.h:399:15: error: initializing argument 1 of 'size_t strlen(const char*)' [-fpermissive] extern size_t strlen (const char *__s) ^ interschimbarelitere.cpp:24:35: error: invalid types 'char[int]' for array subscript if(strchr("aeiouAEIOU",s[i])!=0) ^ interschimbarelitere.cpp:27:23: error: invalid types 'char[int]' for array subscript vocala=s[j]; ^ interschimbarelitere.cpp:31:9: error: invalid types 'char[int]' for array subscript s[iv]=consoana; ^ interschimbarelitere.cpp:32:7: error: 'ic' was not declared in this scope s[ic]=vocala; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema InterschimbareLitere 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ă.