fork download
  1. #include <algorithm>
  2. #include <iostream>
  3.  
  4. char *RGBorder(char *c_a, int num)
  5. {
  6. auto iter = std::partition(c_a, c_a + num, [](char ch) {return ch == 'R';});
  7. std::partition(iter, c_a + num, [](char ch) {return ch == 'G';});
  8. return c_a;
  9. }
  10.  
  11. int main()
  12. {
  13. char ca[] = "GBRRBRGGRRBG";
  14. std::cout << RGBorder(ca, strlen(ca));
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:14:40: error: ‘strlen’ was not declared in this scope
     std::cout << RGBorder(ca, strlen(ca));
                                        ^
stdout
Standard output is empty