#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 | #64310422 | Utilizator | |
| Fișier | pozitii.cpp | Dimensiune | 287 B |
| Data încărcării | 29 Aprilie 2026, 08:55 | Scor/rezultat | Eroare de compilare |
pozitii.cpp: In function ‘int main()’: pozitii.cpp:8:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare] 8 | for(int i=1;i<strlen(s);i++) | ~^~~~~~~~~~ pozitii.cpp:9:18: error: no matching function for call to ‘strchr(char&, const char [6])’ 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ~~~~~~^~~~~~~~~~~~~~ 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 2 would be ill-formed: pozitii.cpp:9:24: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ^~~~~~~ | | | const char* /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 2 would be ill-formed: pozitii.cpp:9:24: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ^~~~~~~ | | | const char* pozitii.cpp:9:41: error: no matching function for call to ‘strchr(char&, const char [7])’ 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ~~~~~~^~~~~~~~~~~~~~~~~ /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 2 would be ill-formed: pozitii.cpp:9:49: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ^~~~~~~~ | | | const char* /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 2 would be ill-formed: pozitii.cpp:9:49: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ^~~~~~~~ | | | const char* pozitii.cpp:9:67: error: no matching function for call to ‘strchr(char&, const char [7])’ 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ~~~~~~^~~~~~~~~~~~~~~~~ /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 2 would be ill-formed: pozitii.cpp:9:75: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ^~~~~~~~ | | | const char* /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 2 would be ill-formed: pozitii.cpp:9:75: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] 9 | if(strchr(s[i],"aeiou")&&!strchr(s[i-1],"aeiou ")&&!strchr(s[i+1],"aeiou ")) | ^~~~~~~~ | | | const char*
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ă.