Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
44126 lnx 忽略大小写的字符串比较 C++ 通过 0 MS 248 KB 542 2024-03-29 14:55:35

Tests(1/1):


#include<bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> using namespace std; char *my_tolower(char *str){ char *orign=str; for(; *str!='\0';str++) *str=tolower(*str); return orign; } int main() { char a[80],b[80]; char* c; char *d; //scanf("%s\n",a); //scanf("%s\n",b); gets(a); gets(b); c=my_tolower(a); d=my_tolower(b); int k=strcmp(c,d); if(k<0) { cout<<"<"; } else if(k==0) { cout<<"="; } else { cout<<">"; } return 0; }


测评信息: