#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 | #54068219 | Utilizator | |
Fișier | inserareasterisc.cpp | Dimensiune | 371 B |
Data încărcării | 19 Noiembrie 2024, 09:10 | Scor / rezultat | Eroare de compilare |
inserareasterisc.cpp: In function 'int main()': inserareasterisc.cpp:9:20: error: invalid conversion from 'const char*' to 'int' [-fpermissive] if(strchr(s,"a")||strchr(s,"i")||strchr(s,"e")||strchr(s,"o")||strchr(s,"u")) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from inserareasterisc.cpp:1: /usr/include/string.h:223:1: error: initializing argument 2 of 'char* strchr(char*, int)' [-fpermissive] strchr (char *__s, int __c) __THROW ^ inserareasterisc.cpp:9:35: error: invalid conversion from 'const char*' to 'int' [-fpermissive] if(strchr(s,"a")||strchr(s,"i")||strchr(s,"e")||strchr(s,"o")||strchr(s,"u")) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from inserareasterisc.cpp:1: /usr/include/string.h:223:1: error: initializing argument 2 of 'char* strchr(char*, int)' [-fpermissive] strchr (char *__s, int __c) __THROW ^ inserareasterisc.cpp:9:50: error: invalid conversion from 'const char*' to 'int' [-fpermissive] if(strchr(s,"a")||strchr(s,"i")||strchr(s,"e")||strchr(s,"o")||strchr(s,"u")) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from inserareasterisc.cpp:1: /usr/include/string.h:223:1: error: initializing argument 2 of 'char* strchr(char*, int)' [-fpermissive] strchr (char *__s, int __c) __THROW ^ inserareasterisc.cpp:9:65: error: invalid conversion from 'const char*' to 'int' [-fpermissive] if(strchr(s,"a")||strchr(s,"i")||strchr(s,"e")||strchr(s,"o")||strchr(s,"u")) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from inserareasterisc.cpp:1: /usr/include/string.h:223:1: error: initializing argument 2 of 'char* strchr(char*, int)' [-fpermissive] strchr (char *__s, int __c) __THROW ^ inserareasterisc.cpp:9:80: error: invalid conversion from 'const char*' to 'int' [-fpermissive] if(strchr(s,"a")||strchr(s,"i")||strchr(s,"e")||strchr(s,"o")||strchr(s,"u")) ^ In file included from /usr/include/c++/4.8/cstring:42:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:48, from inserareasterisc.cpp:1: /usr/include/string.h:223:1: error: initializing argument 2 of 'char* strchr(char*, int)' [-fpermissive] strchr (char *__s, int __c) __THROW ^ inserareasterisc.cpp:10:9: error: 'k' was not declared in this scope k++; ^ inserareasterisc.cpp:11:8: error: 'k' was not declared in this scope if(k==0)cout<<"FARA VOCALE"; ^ inserareasterisc.cpp:12:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] else for(int i=0;i<strlen(s);i++) ^ inserareasterisc.cpp: At global scope: inserareasterisc.cpp:14:4: error: expected unqualified-id before 'else' else cout<<s[i]; ^ inserareasterisc.cpp:16:5: error: expected unqualified-id before 'return' return 0; ^ inserareasterisc.cpp:17:1: error: expected declaration before '}' token } ^
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ă.