基础练习 字符串对比

mac2026-01-28  4

#include <bits/stdc++.h> using namespace std; int main() { string s,a; int flag=0; cin>>s>>a; if(a.length()==s.length()) { if(a==s) { cout<<2; return 0; } for(int i=0;i<a.length();i++)//转小写 { a[i]=tolower(a[i]); s[i]=tolower(s[i]); } //cout<<a<<" "<<s; if(a==s) { cout<<3; return 0; }else{ cout<<4; return 0; } }else { cout<<1; } return 0; }

蓝桥杯练习系统 ID: 56

最新回复(0)