0

Prefix sum??

What is wrong can't run in vs code print sum wrong number . It is run on sololearn but not in vs code Like this 223444555 45667777 34556667 45677885 Why?????????? https://code.sololearn.com/cTFxJyyQOi2D/?ref=app https://code.sololearn.com/cTFxJyyQOi2D/?ref=app

20th Aug 2023, 6:56 PM
Anuj Khare
Anuj Khare - avatar
2 odpowiedzi
0
Anuj Khare , Try to read your warning you got from the SoloLearn compiler. Here's what it told me: ``` ./Playground/file0.cpp: 5:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare] 5 | for(int i=0;i<v.size();i++) ``` try adding long unsigned to `int i`, at line 5. {
21st Aug 2023, 2:23 AM
Dragon RB
Dragon RB - avatar
0
Plus, showing us what error you get from the VSCode compiler may help us a lot from answering your questions, since I don't use it.
21st Aug 2023, 2:34 AM
Dragon RB
Dragon RB - avatar