Să se scrie un program care citeşte de la tastatură un şir de caractere şi elimină din şir toate perechile de vocale consecutive.
Variante Bacalaureat 2009
Problema | EliminarePerechiVocale | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51980298 | Utilizator | |
Fișier | eliminareperechivocale.cpp | Dimensiune | 333 B |
Data încărcării | 14 Septembrie 2024, 08:38 | Scor / rezultat | Eroare de compilare |
eliminareperechivocale.cpp: In function 'int main()': eliminareperechivocale.cpp:6:27: error: expected initializer before '*' token char s[300],sp[]=" ",p*; ^ eliminareperechivocale.cpp:8:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=1;i<strlen(s);i++) ^ eliminareperechivocale.cpp:11:19: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(s[i],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/iostream:38, from eliminareperechivocale.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)) ^ eliminareperechivocale.cpp:11:26: error: invalid conversion from 'char' to 'const char*' [-fpermissive] strcpy(s[i],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/iostream:38, from eliminareperechivocale.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)) ^ eliminareperechivocale.cpp:12:21: error: invalid conversion from 'char' to 'char*' [-fpermissive] strcpy(s[i+1],s[i+2]); ^ 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/iostream:38, from eliminareperechivocale.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)) ^ eliminareperechivocale.cpp:12:28: error: invalid conversion from 'char' to 'const char*' [-fpermissive] strcpy(s[i+1],s[i+2]); ^ 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/iostream:38, from eliminareperechivocale.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)) ^ eliminareperechivocale.cpp:6:17: warning: unused variable 'sp' [-Wunused-variable] char s[300],sp[]=" ",p*; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema EliminarePerechiVocale 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ă.