#136
NumarareCuvinte
Să se scrie un program care citește o propoziție și determină numărul de cuvinte care încep și se termină cu vocală.
Variante Bacalaureat 2009
Problema | NumarareCuvinte | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #55989309 | Utilizator | |
Fișier | numararecuvinte.cpp | Dimensiune | 309 B |
Data încărcării | 02 Februarie 2025, 11:44 | Scor / rezultat | Eroare de compilare |
numararecuvinte.cpp: In function 'int main()': numararecuvinte.cpp:8:11: error: redeclaration of 'char* p' char *p=strtok(s," ") ^ numararecuvinte.cpp:6:19: error: 'char* p' previously declared here char s[251], *p; ^ numararecuvinte.cpp:10:70: warning: comparison with string literal results in unspecified behaviour [-Waddress] if(strchr("aeiouAEIOU",p[0]) && strchr("aeiouAEIOU"<p[strlen(p)-1])) ^ numararecuvinte.cpp:10:70: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] numararecuvinte.cpp:10:71: error: no matching function for call to 'strchr(bool)' if(strchr("aeiouAEIOU",p[0]) && strchr("aeiouAEIOU"<p[strlen(p)-1])) ^ numararecuvinte.cpp:10:71: note: candidates are: In file included from /usr/include/c++/4.8/cstring:42:0, from numararecuvinte.cpp:2: /usr/include/string.h:223:1: note: char* strchr(char*, int) strchr (char *__s, int __c) __THROW ^ /usr/include/string.h:223:1: note: candidate expects 2 arguments, 1 provided /usr/include/string.h:229:1: note: const char* strchr(const char*, int) strchr (const char *__s, int __c) __THROW ^ /usr/include/string.h:229:1: note: candidate expects 2 arguments, 1 provided numararecuvinte.cpp:11:9: error: 'c' was not declared in this scope c++; ^ numararecuvinte.cpp: At global scope: numararecuvinte.cpp:14:1: error: 'cout' does not name a type cout<<c<<endl; ^ numararecuvinte.cpp:15:1: error: expected declaration before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NumarareCuvinte 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ă.