fork download
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. vector<uint8_t> ipNum = {100, 86, 168, 9};
  9. vector<uint8_t> startNum = {100, 86, 168, 9};
  10. vector<uint8_t> endNum = {100, 86, 168, 10};
  11.  
  12.  
  13. cout << std::lexicographical_compare(startNum.begin(), startNum.end(), ipNum.begin(), ipNum.end()) << endl;
  14. cout << std::lexicographical_compare(ipNum.begin(), ipNum.end(), endNum.begin(), endNum.end()) << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5304KB
stdin
Standard input is empty
stdout
0
1