fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int SoS(string str)
  5. { int i,sum=0,n;
  6. n=str.len();
  7. for(i=0;i<n;i++)
  8. { putchar (tolower(str[i]));
  9. sum=sum+int(str[i]);
  10. }
  11. return sum;
  12. }
  13.  
  14.  
  15. int main() {
  16. string x,y;
  17. cin>> x>> y;
  18. int a,b;
  19. a=SoS(x);
  20. b=SoS(y);
  21. if(a==b)
  22. return 0;
  23. else if(a<=b)
  24. return -1;
  25. else
  26. return 1;
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int SoS(std::__cxx11::string)’:
prog.cpp:6:9: error: ‘std::__cxx11::string {aka class std::__cxx11::basic_string<char>}’ has no member named ‘len’
   n=str.len();
         ^~~
stdout
Standard output is empty