竞赛
考级
法兰西玫瑰
超简单
不会C++的一只屑生姜
☭中华c++ HP(互关)
#include<bits/stdc++.h> using namespace std; int n; string b; int main(){ int t; cin>>t; while(t--){ cin>>n>>b; string s="1"; for(int i=1;i<n;i++){ if(b[i]+1!=s[i-1]+b[i-1]-'0'){ s+="1"; }else{ s+="0"; } } cout<<s<<"\n"; } return 0; }
༺དༀ༒☯世一水☯༒ༀཌ༻