#973
Se dă o propoziție care conține numai litere mici ale alfabetului englez și spații. Să se afișeze cuvintele din propoziție care conțin numai vocale.
| Problema | Cuvinte1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64188860 | Utilizator | |
| Fișier | cuvinte1.cpp | Dimensiune | 470 B |
| Data încărcării | 22 Aprilie 2026, 10:06 | Scor/rezultat | Eroare de compilare |
cuvinte1.cpp:1:20: warning: extra tokens at end of #include directive 1 | #include <iostream>#include <string.h>using namespace std; | ^ cuvinte1.cpp: In function ‘int main()’: cuvinte1.cpp:5:5: error: ‘cin’ was not declared in this scope; did you mean ‘std::cin’? 5 | cin.get(x, 255); | ^~~ | std::cin In file included from cuvinte1.cpp:1: /usr/include/c++/13/iostream:62:18: note: ‘std::cin’ declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ cuvinte1.cpp:7:9: error: ‘strtok’ was not declared in this scope; did you mean ‘strtoq’? 7 | p = strtok(x, " "); | ^~~~~~ | strtoq cuvinte1.cpp:10:9: error: ‘strcpy’ was not declared in this scope 10 | strcpy(y, p); | ^~~~~~ cuvinte1.cpp:2:1: note: ‘strcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? 1 | #include <iostream>#include <string.h>using namespace std; +++ |+#include <cstring> 2 | int main() cuvinte1.cpp:12:26: error: ‘strlen’ was not declared in this scope 12 | for (int i =0; i<strlen(y); i++) | ^~~~~~ cuvinte1.cpp:12:26: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? cuvinte1.cpp:14:17: error: ‘strchr’ was not declared in this scope 14 | if (strchr("aeiou", y[i])) | ^~~~~~ cuvinte1.cpp:14:17: note: ‘strchr’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? cuvinte1.cpp:17:19: error: ‘strlen’ was not declared in this scope 17 | if (nr == strlen(y)) | ^~~~~~ cuvinte1.cpp:17:19: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? cuvinte1.cpp:18:13: error: ‘cout’ was not declared in this scope; did you mean ‘std::cout’? 18 | cout << y << endl; | ^~~~ | std::cout /usr/include/c++/13/iostream:63:18: note: ‘std::cout’ declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ cuvinte1.cpp:18:26: error: ‘endl’ was not declared in this scope; did you mean ‘std::endl’? 18 | cout << y << endl; | ^~~~ | std::endl In file included from /usr/include/c++/13/iostream:41: /usr/include/c++/13/ostream:735:5: note: ‘std::endl’ declared here 735 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Cuvinte1 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ă.