fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int MAX_SIZE = 100;
  5.  
  6. int strcmpf(char firstText[], char secondText[]) {
  7. int i = 0;
  8. while (firstText[i] - secondText[i] == 0 && firstText[i]) {
  9. ++i;
  10. }
  11. return firstText[i] - secondText[i];
  12. }
  13.  
  14. int main() {
  15. char firstText[MAX_SIZE + 1], secondText[MAX_SIZE + 1];
  16. cin >> firstText >> secondText;
  17. cout << strcmpf(firstText, secondText);
  18. return 0;
  19. }
Success #stdin #stdout 0.01s 5288KB
stdin
Hello Hellow
stdout
-119