问题描述
自己实现一个比较字符串大小的函数,也即实现strcmp函数。函数:int myStrcmp(char *s1,char *s2) 按照ASCII顺序比较字符串s1与s2。若s1与s2相等返回0,s1>s2返回1,s1
#include <iostream>
#include <vector>
#include <string>
#include <queue>
using namespace std;
int myStrcmp(string s1, string s2) {
for (int i = 0; i < s1.length() || i < s2.length(); i++) {
if (s1[i] > s2[i]) {