#972
Se dă un șir de caractere. Să se determine câte vocale din șir sunt cuprinse între două consoane.
| Problema | Pozitii | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64831336 | Utilizator | |
| Fișier | pozitii.cpp | Dimensiune | 281 B |
| Data încărcării | 04 Iunie 2026, 12:44 | Scor/rezultat | Eroare de compilare |
pozitii.cpp: In function ‘int main()’: pozitii.cpp:8:13: error: ‘strlen’ was not declared in this scope 8 | for (i=0;i<strlen(s);i++) | ^~~~~~ pozitii.cpp:3:1: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? 2 | #include <cmath> +++ |+#include <cstring> 3 | using namespace std; pozitii.cpp:9:17: error: ‘voc’ was not declared in this scope; did you mean ‘vo’? 9 | if (strchr(voc,s[i])!=0 && strchr(voc,s[i]-1)==0 && strchr(voc,s[i]+1)==0) nr++; | ^~~ | vo pozitii.cpp:9:10: error: ‘strchr’ was not declared in this scope 9 | if (strchr(voc,s[i])!=0 && strchr(voc,s[i]-1)==0 && strchr(voc,s[i]+1)==0) nr++; | ^~~~~~ pozitii.cpp:9:10: note: ‘strchr’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’? pozitii.cpp:8:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 8 | for (i=0;i<strlen(s);i++) | ^~~ pozitii.cpp:10:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 10 | cout<<nr; | ^~~~
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Pozitii 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ă.