Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
74596 刘世杰 奇怪的国家 C++ Accepted 0 MS 280 KB 756 2024-05-25 16:25:12

Tests(10/10):


Code:

#include <iostream> #include <string> using namespace std; string judge(string str1,string str2); int main(){ string str1; string str2; cin>>str1; cin>>str2; cout<<judge(str1,str2); return 0; } string judge(string str1,string str2){ string str3; string s1(str1); string s2(str2); int i=0; if((str1.length()>0||str1.length()<51)&&(str2.length()>0||str2.length()<51)){ while((s1.data()[i]=='0'||s1.data()[i]=='1')&&(s2.data()[i]=='0'||s2.data()[i]=='1')){ if(s1.data()[i]==s2.data()[i]){ str3.append("1"); } else{ str3.append("0"); } i++; } return str3; } }