#4103
Se dă un vector cu n numere naturale, n fiind număr par. Să se verifice dacă toate perechile de elemente egal depărtate de capetele vectorului au aceeași paritate.
| Problema | VerifParitate1 | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64490271 | Utilizator | |
| Fișier | verifparitate1.cpp | Dimensiune | 471 B |
| Data încărcării | 11 Mai 2026, 00:41 | Scor/rezultat | Eroare de compilare |
verifparitate1.cpp: In function ‘int main()’: verifparitate1.cpp:15:18: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 15 | if ( ( (a%2==0) && (b%2==0) ) || ( (a%2==1) && (b%2==1) ) | ^ verifparitate1.cpp:15:70: error: expected ‘;’ before ‘c’ 15 | if ( ( (a%2==0) && (b%2==0) ) || ( (a%2==1) && (b%2==1) ) | ^ | ; 16 | c++; | ~ verifparitate1.cpp:15:43: warning: statement has no effect [-Wunused-value] 15 | if ( ( (a%2==0) && (b%2==0) ) || ( (a%2==1) && (b%2==1) ) | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ verifparitate1.cpp:17:9: error: expected primary-expression before ‘}’ token 17 | } | ^ verifparitate1.cpp:16:21: error: expected ‘)’ before ‘}’ token 16 | c++; | ^ | ) 17 | } | ~ verifparitate1.cpp:15:16: note: to match this ‘(’ 15 | if ( ( (a%2==0) && (b%2==0) ) || ( (a%2==1) && (b%2==1) ) | ^ verifparitate1.cpp:17:9: error: expected primary-expression before ‘}’ token 17 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema VerifParitate1 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ă.