#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 | #64827420 | Utilizator | |
| Fișier | cuvinte1.cpp | Dimensiune | 419 B |
| Data încărcării | 04 Iunie 2026, 09:04 | Scor/rezultat | Eroare de compilare |
cuvinte1.cpp:12:23: warning: character constant too long for its type 12 | if(strchr('aeiou',p[i])==0); | ^~~~~~~ cuvinte1.cpp: In function ‘int main()’: cuvinte1.cpp:11:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 11 | for(int i = i ; i <strlen(p)-1;i++) | ~~^~~~~~~~~~~~ cuvinte1.cpp:12:22: error: no matching function for call to ‘strchr(int, char&)’ 12 | if(strchr('aeiou',p[i])==0); | ~~~~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/13/cstring:42, from cuvinte1.cpp:2: /usr/include/string.h:239:1: note: candidate: ‘const char* strchr(const char*, int)’ (near match) 239 | strchr (const char *__s, int __c) __THROW | ^~~~~~ /usr/include/string.h:239:1: note: conversion of argument 1 would be ill-formed: cuvinte1.cpp:12:23: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive] 12 | if(strchr('aeiou',p[i])==0); | ^~~~~~~ | | | int /usr/include/string.h:233:1: note: candidate: ‘char* strchr(char*, int)’ (near match) 233 | strchr (char *__s, int __c) __THROW | ^~~~~~ /usr/include/string.h:233:1: note: conversion of argument 1 would be ill-formed: cuvinte1.cpp:12:23: error: invalid conversion from ‘int’ to ‘char*’ [-fpermissive] 12 | if(strchr('aeiou',p[i])==0); | ^~~~~~~ | | | int cuvinte1.cpp:11:9: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 11 | for(int i = i ; i <strlen(p)-1;i++) | ^~~ cuvinte1.cpp:13:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 13 | ok = 0; | ^~ cuvinte1.cpp:14:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 14 | if(ok) | ^~ cuvinte1.cpp:16:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 16 | p = strtok(NULL," "); | ^
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ă.