#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 | #64818713 | Utilizator | |
| Fișier | pozitii.cpp | Dimensiune | 334 B |
| Data încărcării | 03 Iunie 2026, 13:40 | Scor/rezultat | Eroare de compilare |
pozitii.cpp: In function ‘int main()’: pozitii.cpp:10:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 10 | for(i=1;i<strlen(s)-1;i++) | ~^~~~~~~~~~~~ pozitii.cpp:12:12: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 12 | if(strchr("aeiou",s[i]) && strchr("aeiou",s[i-1]==NULL && strchr("aeiou",s[i+1])==NULL) | ^~~~~~ pozitii.cpp:12:59: warning: NULL used in arithmetic [-Wpointer-arith] 12 | if(strchr("aeiou",s[i]) && strchr("aeiou",s[i-1]==NULL && strchr("aeiou",s[i+1])==NULL) | ^~~~ pozitii.cpp:12:96: error: expected ‘;’ before ‘k’ 12 | if(strchr("aeiou",s[i]) && strchr("aeiou",s[i-1]==NULL && strchr("aeiou",s[i+1])==NULL) | ^ | ; 13 | k++; | ~ pozitii.cpp:12:33: warning: statement has no effect [-Wunused-value] 12 | if(strchr("aeiou",s[i]) && strchr("aeiou",s[i-1]==NULL && strchr("aeiou",s[i+1])==NULL) | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pozitii.cpp:14:5: error: expected primary-expression before ‘}’ token 14 | } | ^ pozitii.cpp:13:16: error: expected ‘)’ before ‘}’ token 13 | k++; | ^ | ) 14 | } | ~ pozitii.cpp:12:11: note: to match this ‘(’ 12 | if(strchr("aeiou",s[i]) && strchr("aeiou",s[i-1]==NULL && strchr("aeiou",s[i+1])==NULL) | ^ pozitii.cpp:14:5: error: expected primary-expression before ‘}’ token 14 | } | ^
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ă.