#4279
Se citesc de la tastatură numerele n k
, apoi n
numere naturale. Să se determine suma celor impare și câte dintre ele se divid cu k
.
Problema | SumCnt2 | Operații I/O |
![]() |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58419863 | Utilizator | |
Fișier | sumcnt2.cpp | Dimensiune | 194 B |
Data încărcării | 03 Iunie 2025, 10:41 | Scor / rezultat | Eroare de compilare |
sumcnt2.cpp: In function 'int main()': sumcnt2.cpp:6:11: warning: right operand of comma operator has no effect [-Wunused-value] for(i=1,i<=n,i++) ^ sumcnt2.cpp:6:18: error: expected ';' before ')' token for(i=1,i<=n,i++) ^ sumcnt2.cpp:12:19: error: expected primary-expression at end of input cout<<S<<" "<<c;} ^ sumcnt2.cpp:12:19: error: expected ';' at end of input sumcnt2.cpp:12:19: error: expected primary-expression at end of input sumcnt2.cpp:12:19: error: expected ')' at end of input sumcnt2.cpp:12:19: error: expected statement at end of input sumcnt2.cpp:4:6: warning: unused variable 'S' [-Wunused-variable] {int S=0,n,x,i,C=0; ^ sumcnt2.cpp:4:16: warning: unused variable 'C' [-Wunused-variable] {int S=0,n,x,i,C=0; ^ sumcnt2.cpp:12:19: error: expected '}' at end of input cout<<S<<" "<<c;} ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SumCnt2 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ă.