#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 | #64774261 | Utilizator | |
| Fișier | pozitii.cpp | Dimensiune | 351 B |
| Data încărcării | 29 Mai 2026, 12:03 | Scor/rezultat | Eroare de compilare |
pozitii.cpp:11:19: warning: character constant too long for its type 11 | if(strchr('aeiou',c[i]) | ^~~~~~~ pozitii.cpp:13:27: warning: character constant too long for its type 13 | if(!strchr('aeiou',c[i-1]&& !strchr('aeiou',c[i+1]) | ^~~~~~~ pozitii.cpp:13:52: warning: character constant too long for its type 13 | if(!strchr('aeiou',c[i-1]&& !strchr('aeiou',c[i+1]) | ^~~~~~~ pozitii.cpp: In function ‘int main()’: pozitii.cpp:11:18: error: no matching function for call to ‘strchr(int, char&)’ 11 | if(strchr('aeiou',c[i]) | ~~~~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/13/cstring:42, from pozitii.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: pozitii.cpp:11:19: error: invalid conversion from ‘int’ to ‘const char*’ [-fpermissive] 11 | if(strchr('aeiou',c[i]) | ^~~~~~~ | | | 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: pozitii.cpp:11:19: error: invalid conversion from ‘int’ to ‘char*’ [-fpermissive] 11 | if(strchr('aeiou',c[i]) | ^~~~~~~ | | | int pozitii.cpp:11:32: error: expected ‘)’ before ‘{’ token 11 | if(strchr('aeiou',c[i]) | ~ ^ | ) 12 | { | ~ pozitii.cpp:16:5: error: expected primary-expression before ‘}’ token 16 | } | ^
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ă.