Job 21056

Owner
keegotp
Problem
Sequence
Source
2.33KB
Result
Wrong answer

Compiler output

prog.cpp: In function 'std::vector<std::basic_string<char> > split(std::string, char)':
prog.cpp:33:105: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 vector<string> split(string s, char sep){int prev_index = 0;int i = 0;vector<string> words;for(i = 0; i < s.size(); i++){if(s[i] == sep){words.push_back(s.substr(prev_index, i - prev_index));prev_index = i + 1;}}words.push_back(s.substr(prev_index, (s.size() - prev_index )));return words;}
                                                                                                         ^

Results

Test numberResultTime
1Wrong answer0.5283s
Questions?

Sponsors Gold