#110
Eliminare
Să se scrie un program care citeşte de la tastatură un cuvănt şi afişează pe ecran toate cuvintele care se pot obţine prin eliminarea unei singure litere din cuvântul citit.
Variante Bacalaureat 2009
Problema | Eliminare | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53766451 | Utilizator | |
Fișier | eliminare.cpp | Dimensiune | 229 B |
Data încărcării | 11 Noiembrie 2024, 11:17 | Scor / rezultat | Eroare de compilare |
eliminare.cpp: In function 'int main()': eliminare.cpp:8:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(i=0;i<strlen(S);i++) ^ eliminare.cpp:10:2: error: invalid conversion from 'char*' to 'int' [-fpermissive] a=S; ^ eliminare.cpp:11:17: error: invalid conversion from 'int' to 'char*' [-fpermissive] strcpy(aux,a+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 eliminare.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)) ^ eliminare.cpp:11:15: error: invalid conversion from 'int' to 'const char*' [-fpermissive] strcpy(aux,a+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 eliminare.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)) ^ eliminare.cpp:12:9: error: invalid conversion from 'int' to 'char*' [-fpermissive] strcpy(a+1,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/iostream:38, from eliminare.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)) ^ eliminare.cpp:12:15: error: invalid conversion from 'int' to 'const char*' [-fpermissive] strcpy(a+1,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/iostream:38, from eliminare.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)) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Eliminare 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ă.