#943
Suma4
Se dă n
un număr natural nenul. Să se afle ultima cifră a sumei S=1
4
+ 2
4
+ 3
4
+ ... + n
4
.
Problema | Suma4 | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #51566255 | Utilizator | |
Fișier | suma4.cpp | Dimensiune | 323 B |
Data încărcării | 12 Iulie 2024, 16:16 | Scor / rezultat | Eroare de compilare |
suma4.cpp: In function 'int main()': suma4.cpp:11:28: warning: left operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:31: warning: right operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:34: warning: right operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:37: warning: right operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:40: warning: right operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:43: warning: right operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:46: warning: right operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:49: warning: right operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:52: warning: right operand of comma operator has no effect [-Wunused-value] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:11:53: error: invalid conversion from 'int*' to 'int' [-fpermissive] int lista = new int[0, 1, 6, 1, 6, 5, 6, 1, 6, 1]; ^ suma4.cpp:15:22: error: invalid types 'int[int]' for array subscript sum+=lista[uc]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Suma4 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ă.