#include <iostream> using namespace std; int mystrcmp(const char* src, const char* dst); int main() { char s1[100] = { 0 }; char s2[100] = { 0 }; cin.getline(s1, sizeof(s1)); cin.getline(s2, sizeof(s2)); int ret = mystrcmp(s1, s2); cout << ret << endl; return 0; } int mystrcmp(const char* src, const char* dst) { // write your code here...... int i=0; int cmp; for(i;src[i]!='\0',dst[i]!='\0';i=i+1) { if(src[i]>dst[i]) { cmp=1; break; } else if(src[i] < dst[i]) { cmp=-1; break; } else if(src[i] == dst[i]) { if(src[i+1] == '\0') { cmp=0; } else if(src[i+1] != '\0') { cmp=1; } } } return cmp; }